summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-08-30 10:09:59 -0700
committerTanner Gooding <tagoo@outlook.com>2018-09-06 17:07:08 -0700
commitad3c8cc8934ec89631c221713b86238f6c86e1b6 (patch)
treee7005b0c8e6ea5ff367a09246a6edf5a40e162e5 /src/pal
parente80e55a1ace4b4de10072b0f6f71f79aca868906 (diff)
downloadcoreclr-ad3c8cc8934ec89631c221713b86238f6c86e1b6.tar.gz
coreclr-ad3c8cc8934ec89631c221713b86238f6c86e1b6.tar.bz2
coreclr-ad3c8cc8934ec89631c221713b86238f6c86e1b6.zip
Updating Number.Formatting to properly print -0
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal.h2
-rw-r--r--src/pal/src/cruntime/math.cpp56
2 files changed, 58 insertions, 0 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index e7ec886e87..2d0c47177b 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -4459,6 +4459,7 @@ PALIMPORT LONG __cdecl labs(LONG);
// clang complains if this is declared with __int64
PALIMPORT long long __cdecl llabs(long long);
+PALIMPORT int __cdecl _signbit(double);
PALIMPORT int __cdecl _finite(double);
PALIMPORT int __cdecl _isnan(double);
PALIMPORT double __cdecl _copysign(double, double);
@@ -4487,6 +4488,7 @@ PALIMPORT double __cdecl sqrt(double);
PALIMPORT double __cdecl tan(double);
PALIMPORT double __cdecl tanh(double);
+PALIMPORT int __cdecl _signbitf(float);
PALIMPORT int __cdecl _finitef(float);
PALIMPORT int __cdecl _isnanf(float);
PALIMPORT float __cdecl _copysignf(float, float);
diff --git a/src/pal/src/cruntime/math.cpp b/src/pal/src/cruntime/math.cpp
index a36ac9aa93..af2f99416e 100644
--- a/src/pal/src/cruntime/math.cpp
+++ b/src/pal/src/cruntime/math.cpp
@@ -45,6 +45,34 @@ SET_DEFAULT_DEBUG_CHANNEL(CRT);
/*++
Function:
+ _signbit
+
+Determines whether given double-precision floating point value has a negative sign.
+
+Return Value
+
+_signbit returns a nonzero value (TRUE) if the sign of its argument x is negative.
+
+Parameter
+
+x Double-precision floating-point value
+
+--*/
+int __cdecl _signbit(double x)
+{
+ int ret;
+ PERF_ENTRY(_signbit);
+ ENTRY("_signbit (x=%f)\n", x);
+
+ ret = signbit(x);
+
+ LOGEXIT("_signbit returns int %d\n", ret);
+ PERF_EXIT(_signbit);
+ return ret;
+}
+
+/*++
+Function:
_finite
Determines whether given double-precision floating point value is finite.
@@ -455,6 +483,34 @@ PALIMPORT double __cdecl PAL_pow(double x, double y)
/*++
Function:
+ _signbitf
+
+Determines whether given single-precision floating point value has a negative sign.
+
+Return Value
+
+_signbitf returns a nonzero value (TRUE) if the sign of its argument x is negative.
+
+Parameter
+
+x Single-precision floating-point value
+
+--*/
+int __cdecl _signbitf(float x)
+{
+ int ret;
+ PERF_ENTRY(_signbitf);
+ ENTRY("_signbitf (x=%f)\n", x);
+
+ ret = signbit(x);
+
+ LOGEXIT("_signbitf returns int %d\n", ret);
+ PERF_EXIT(_signbitf);
+ return ret;
+}
+
+/*++
+Function:
_finitef
Determines whether given single-precision floating point value is finite.