diff options
Diffstat (limited to 'newlib/libm/mathfp/s_frexp.c')
-rw-r--r-- | newlib/libm/mathfp/s_frexp.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/newlib/libm/mathfp/s_frexp.c b/newlib/libm/mathfp/s_frexp.c index 54fa336c8..6145c472f 100644 --- a/newlib/libm/mathfp/s_frexp.c +++ b/newlib/libm/mathfp/s_frexp.c @@ -26,17 +26,17 @@ TRAD_SYNOPSIS DESCRIPTION - All nonzero, normal numbers can be described as <[m]> * 2**<[p]>. + All non zero, normal numbers can be described as <[m]> * 2**<[p]>. <<frexp>> represents the double <[val]> as a mantissa <[m]> and a power of two <[p]>. The resulting mantissa will always be greater than or equal to <<0.5>>, and less than <<1.0>> (as long as <[val]> is nonzero). The power of two will be stored in <<*>><[exp]>. -@ifnottex +@ifinfo <[m]> and <[p]> are calculated so that <[val]> is <[m]> times <<2>> to the power <[p]>. -@end ifnottex +@end ifinfo @tex <[m]> and <[p]> are calculated so that $ val = m \times 2^p $. @@ -82,17 +82,6 @@ double frexp (double d, int *exp) double f; __uint32_t hd, ld, hf, lf; - /* Check for special values. */ - switch (numtest (d)) - { - case NAN: - case INF: - errno = EDOM; - case 0: - *exp = 0; - return (d); - } - EXTRACT_WORDS (hd, ld, d); /* Get the exponent. */ @@ -105,6 +94,16 @@ double frexp (double d, int *exp) INSERT_WORDS (f, hf, lf); + /* Check for special values. */ + switch (numtest (f)) + { + case NAN: + case INF: + errno = EDOM; + *exp = 0; + return (f); + } + return (f); } |