summaryrefslogtreecommitdiffstats
path: root/core/math/math_funcs.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-05-01 11:37:46 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-05-01 11:37:46 +0200
commit6883325f926af425cf1db7606506f5538b7a205a (patch)
tree4e1e35159b1b7024948c78fa28710ecd388ca882 /core/math/math_funcs.cpp
parent78adbf4790a080fc02778a1a67d06dfcdf28290c (diff)
downloadredot-engine-6883325f926af425cf1db7606506f5538b7a205a.tar.gz
math: Fix rounding error for 0 in Math::round (#4495)
Thus revert the previous workaround in commit b123bc4a2a9c07fcfd27a84109960bda158b3b9d. Fixes #3221.
Diffstat (limited to 'core/math/math_funcs.cpp')
-rw-r--r--core/math/math_funcs.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index 07f114725d..0fbd031214 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -135,18 +135,20 @@ double Math::rad2deg(double p_y) {
double Math::round(double p_val) {
- if (p_val>0) {
+ if (p_val>=0) {
return ::floor(p_val+0.5);
} else {
p_val=-p_val;
return -::floor(p_val+0.5);
}
}
+
double Math::asin(double p_x) {
return ::asin(p_x);
}
+
double Math::acos(double p_x) {
return ::acos(p_x);