mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-08 07:42:09 +03:00
add significand[fl] math functions
This commit is contained in:
parent
0c42beb5f9
commit
2242bf616b
@ -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
7
src/math/significand.c
Normal 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
7
src/math/significandf.c
Normal 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
7
src/math/significandl.c
Normal file
@ -0,0 +1,7 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <math.h>
|
||||
|
||||
long double significandl(long double x)
|
||||
{
|
||||
return scalbnl(x, -ilogbl(x));
|
||||
}
|
Loading…
Reference in New Issue
Block a user