mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- fpclassify() now returns FP_ZERO both for 0 and -0.
- nan() and nanf() now return quiet NaNs. - Added internal __inf() and __inff() functions. - strtof() now calls nanf() and __inff(), respectively, to produce the special floating point values for nan/inf/infinity. - strtod() now calls nan() and __inf(), respectively, to produce the special floating point values for nan/inf/infinity. - The scanf() family now calls nan() and __inf(), respectively, to produce the special floating point values for nan/inf/infinity. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14948 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_strtod.c,v 1.6 2005-05-08 11:27:26 obarthel Exp $
|
||||
* $Id: stdlib_strtod.c,v 1.7 2005-05-14 10:52:31 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -123,22 +123,14 @@ strtod(const char *str, char ** ptr)
|
||||
/* We begin by checking for the "inf" and "nan" strings. */
|
||||
if(strcasecmp(str,"inf") == SAME || strcasecmp(str,"infinity") == SAME)
|
||||
{
|
||||
union ieee_double x;
|
||||
|
||||
SHOWMSG("infinity");
|
||||
|
||||
str += strlen(str);
|
||||
|
||||
/* Exponent = 2047 and fraction = 0.0 */
|
||||
x.raw[0] = 0x7ff00000;
|
||||
x.raw[1] = 0x00000000;
|
||||
|
||||
sum = x.value;
|
||||
sum = __inf();
|
||||
}
|
||||
else if (strncasecmp(str,"nan",3) == SAME && (str[3] == '(' || str[3] == '\0'))
|
||||
{
|
||||
union ieee_double x;
|
||||
|
||||
SHOWMSG("not a number");
|
||||
|
||||
str += 3;
|
||||
@ -153,11 +145,7 @@ strtod(const char *str, char ** ptr)
|
||||
str++;
|
||||
}
|
||||
|
||||
/* Exponent = 2047 and fraction != 0.0 */
|
||||
x.raw[0] = 0x7ff00000;
|
||||
x.raw[1] = 0x00000001;
|
||||
|
||||
sum = x.value;
|
||||
sum = nan(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user