add significand[fl] math functions

This commit is contained in:
Rich Felker 2012-08-13 14:51:43 -04:00
parent 0c42beb5f9
commit 2242bf616b
4 changed files with 25 additions and 0 deletions

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
src/math/significand.c Normal file
View File

@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
double significand(double x)
{
return scalbn(x, -ilogb(x));
}

7
src/math/significandf.c Normal file
View File

@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
float significandf(float x)
{
return scalbnf(x, -ilogbf(x));
}

7
src/math/significandl.c Normal file
View File

@ -0,0 +1,7 @@
#define _GNU_SOURCE
#include <math.h>
long double significandl(long double x)
{
return scalbnl(x, -ilogbl(x));
}