Write negative zero as '-0.0'. Otherwise, it is parsed as an integer

before being cast to a floating point type, and the sign is lost.
This commit is contained in:
David Schultz 2003-03-27 05:32:28 +00:00
parent 0f0dfee4d5
commit 0c66f5adc3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112698

View File

@ -35,7 +35,7 @@ main(void)
{
assert(fpclassify((float)0) == FP_ZERO);
assert(fpclassify((float)-0) == FP_ZERO);
assert(fpclassify((float)-0.0) == FP_ZERO);
assert(fpclassify((float)1) == FP_NORMAL);
assert(fpclassify((float)1000) == FP_NORMAL);
#ifndef __alpha__
@ -59,7 +59,7 @@ main(void)
assert(fpclassify((double)NAN) == FP_NAN);
assert(fpclassify((long double)0) == FP_ZERO);
assert(fpclassify((long double)-0) == FP_ZERO);
assert(fpclassify((long double)-0.0) == FP_ZERO);
assert(fpclassify((long double)1) == FP_NORMAL);
assert(fpclassify((long double)1000) == FP_NORMAL);
#ifndef __alpha__