summaryrefslogtreecommitdiffstats
path: root/modules/fdlibm/src/e_pow.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-15 14:00:18 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-15 14:00:18 +0100
commit6ca0b4704367f8804e0373cb439e6e17e5146e4a (patch)
tree31ce5042bb575dd1afd6d309467c0c0d36e18914 /modules/fdlibm/src/e_pow.cpp
parent85c60f94fb584ecab49743ab533e56f0f9981ecc (diff)
downloadUXP-6ca0b4704367f8804e0373cb439e6e17e5146e4a.tar
UXP-6ca0b4704367f8804e0373cb439e6e17e5146e4a.tar.gz
UXP-6ca0b4704367f8804e0373cb439e6e17e5146e4a.tar.lz
UXP-6ca0b4704367f8804e0373cb439e6e17e5146e4a.tar.xz
UXP-6ca0b4704367f8804e0373cb439e6e17e5146e4a.zip
Issue #1291 - Part 2: Stop using the lib's sqrt() function
Use <cmath>'s functions over fdlibm's for performance reasons. No significant precision loss when doing this.
Diffstat (limited to 'modules/fdlibm/src/e_pow.cpp')
-rw-r--r--modules/fdlibm/src/e_pow.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
index 366e3933b..7f22afce8 100644
--- a/modules/fdlibm/src/e_pow.cpp
+++ b/modules/fdlibm/src/e_pow.cpp
@@ -57,6 +57,8 @@
* to produce the hexadecimal values shown.
*/
+#include <cmath>
+
#include "math_private.h"
static const double
@@ -152,7 +154,7 @@ __ieee754_pow(double x, double y)
if(hy==0x40000000) return x*x; /* y is 2 */
if(hy==0x3fe00000) { /* y is 0.5 */
if(hx>=0) /* x >= +0 */
- return sqrt(x);
+ return std::sqrt(x);
}
}