add significand[fl] math functions

This commit is contained in:
Rich Felker committed 2012-08-13 14:51:43 -04:00
1 parent 0c42beb5f9
commit 2242bf616b
4 files changed
+25

No files matched your search

+4
View File
@@ -400,6 +400,10 @@ long double exp10l(long double);
double pow10(double);
float pow10f(float);
long double pow10l(long double);
double significand(double);
float significandf(float);
long double significandl(long double);
#endif
#ifdef __cplusplus
+7
View File
@@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
double significand(double x)
{
return scalbn(x, -ilogb(x));
}
+7
View File
@@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
float significandf(float x)
{
return scalbnf(x, -ilogbf(x));
}
+7
View File
@@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
long double significandl(long double x)
{
return scalbnl(x, -ilogbl(x));
}