1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2024-11-09 21:32:02 +05:30

floatscan-experiment.c: implement copysignl

This commit is contained in:
Intel A80486DX2-66 2024-06-25 12:17:46 +03:00
parent 7fae55a31e
commit 006b4ec9b2
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -47,6 +47,7 @@
/* wrapping code --- beginning */ /* wrapping code --- beginning */
const char* fgetc_ptr = NULL; const char* fgetc_ptr = NULL;
static long double copysignl(long double mag, long double sgn);
static int __shgetc(void); static int __shgetc(void);
static int __shunget(void); static int __shunget(void);
static long double interface_floatscan(const char* s, int prec); static long double interface_floatscan(const char* s, int prec);
@ -567,6 +568,10 @@ long double __floatscan(FILE *f, int prec, int pok)
/* the original musl libc code --- end */ /* the original musl libc code --- end */
/* wrapping code --- beginning */ /* wrapping code --- beginning */
static long double copysignl(long double mag, long double sgn) {
return fabsl(mag) * (sgn < 0 ? -1 : 1);
}
static int __shgetc(void) { static int __shgetc(void) {
return *fgetc_ptr++; return *fgetc_ptr++;
} }