1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-08 08:54:34 +05:30

floatscan-experiment.c: always use local copysignl

This commit is contained in:
Intel A80486DX2-66 2024-06-25 16:42:28 +03:00
parent ba278632e2
commit 1def3d4b9c
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -47,7 +47,7 @@
/* wrapping code --- beginning */
const char* fgetc_ptr = NULL;
static long double copysignl(long double mag, long double sgn);
static long double my_copysignl(long double mag, long double sgn);
static int __shgetc(void);
static int __shunget(void);
static long double interface_floatscan(const char* s, int prec);
@ -331,7 +331,7 @@ static long double decfloat(FILE *f, int c, int bits, int emin, int sign,
/* Calculate bias term to force rounding, move out lower bits */
if (bits < LDBL_MANT_DIG) {
bias = copysignl(scalbn(1, 2*LDBL_MANT_DIG-bits-1), y);
bias = my_copysignl(scalbn(1, 2*LDBL_MANT_DIG-bits-1), y);
frac = fmodl(y, scalbn(1, LDBL_MANT_DIG-bits));
y -= frac;
y += bias;
@ -471,7 +471,7 @@ static long double hexfloat(FILE *f, int bits, int emin, int sign, int pok)
}
if (bits < LDBL_MANT_DIG)
bias = copysignl(scalbn(1, 32+LDBL_MANT_DIG-bits-1), sign);
bias = my_copysignl(scalbn(1, 32+LDBL_MANT_DIG-bits-1), sign);
if (bits<32 && y && !(x&1)) x++, y=0;
@ -568,7 +568,7 @@ long double __floatscan(FILE *f, int prec, int pok)
/* the original musl libc code --- end */
/* wrapping code --- beginning */
static long double copysignl(long double mag, long double sgn) {
static long double my_copysignl(long double mag, long double sgn) {
return fabsl(mag) * (sgn < 0 ? -1 : 1);
}