diff options
Diffstat (limited to 'scene/gui/range.cpp')
-rw-r--r-- | scene/gui/range.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index d5c1034c9c..5ecafccaca 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -141,8 +141,8 @@ void Range::set_as_ratio(double p_value) { if (shared->exp_ratio && get_min()>0) { - double exp_min = Math::log(get_min())/Math::log(2); - double exp_max = Math::log(get_max())/Math::log(2); + double exp_min = Math::log(get_min())/Math::log((double)2); + double exp_max = Math::log(get_max())/Math::log((double)2); v = Math::pow(2,exp_min+(exp_max-exp_min)*p_value); } else { @@ -160,9 +160,9 @@ double Range::get_as_ratio() const { if (shared->exp_ratio && get_min()>0) { - double exp_min = Math::log(get_min())/Math::log(2); - double exp_max = Math::log(get_max())/Math::log(2); - double v = Math::log(get_value())/Math::log(2); + double exp_min = Math::log(get_min())/Math::log((double)2); + double exp_max = Math::log(get_max())/Math::log((double)2); + double v = Math::log(get_value())/Math::log((double)2); return (v - exp_min) / (exp_max - exp_min); |