GFC_REAL_10 nearest_r10 (GFC_REAL_10 s, GFC_REAL_10 dir) { dir = MATHFUNC(copysign) (MATHFUNC(__builtin_inf) (), dir); if (FLT_EVAL_METHOD != 0) { /* ??? Work around glibc bug on x86. */ volatile GFC_REAL_10 r = MATHFUNC(nextafter) (s, dir); return r; } else return MATHFUNC(nextafter) (s, dir); }
GFC_REAL_16 spacing_r16 (GFC_REAL_16 s, int p, int emin, GFC_REAL_16 tiny) { int e; if (s == 0.) return tiny; MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; #if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL)) return MATHFUNC(ldexp) (1., e); #else return MATHFUNC(scalbn) (1., e); #endif }
GFC_REAL_10 spacing_r10 (GFC_REAL_10 s, int p, int emin, GFC_REAL_10 tiny) { int e; if (s == 0.) return tiny; MATHFUNC(frexp) (s, &e); e = e - p; e = e > emin ? e : emin; #if defined (HAVE_LDEXPL) return MATHFUNC(ldexp) (1., e); #else return MATHFUNC(scalbn) (1., e); #endif }
GFC_REAL_16 rrspacing_r16 (GFC_REAL_16 s, int p) { int e; GFC_REAL_16 x; x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; MATHFUNC(frexp) (s, &e); #if (defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_LDEXPL)) return MATHFUNC(ldexp) (x, p - e); #else return MATHFUNC(scalbn) (x, p - e); #endif }
GFC_INTEGER_4 exponent_r10 (GFC_REAL_10 s) { int ret; MATHFUNC(frexp) (s, &ret); return ret; }
GFC_REAL_8 rrspacing_r8 (GFC_REAL_8 s, int p) { int e; GFC_REAL_8 x; x = MATHFUNC(fabs) (s); if (x == 0.) return 0.; MATHFUNC(frexp) (s, &e); #if defined (HAVE_LDEXP) return MATHFUNC(ldexp) (x, p - e); #else return MATHFUNC(scalbn) (x, p - e); #endif }
GFC_REAL_16 fraction_r16 (GFC_REAL_16 s) { int dummy_exp; return MATHFUNC(frexp) (s, &dummy_exp); }
GFC_REAL_10 fraction_r10 (GFC_REAL_10 s) { int dummy_exp; return MATHFUNC(frexp) (s, &dummy_exp); }
GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i) { int dummy_exp; return MATHFUNC(scalbn) (MATHFUNC(frexp) (s, &dummy_exp), i); }
GFC_REAL_8 fraction_r8 (GFC_REAL_8 s) { int dummy_exp; return MATHFUNC(frexp) (s, &dummy_exp); }
GFC_REAL_4 fraction_r4 (GFC_REAL_4 s) { int dummy_exp; return MATHFUNC(frexp) (s, &dummy_exp); }