mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-17 20:06:49 +00:00
da6898214f
These had implicitly assumed that floating-point constants had only double precision, rather than extended.
30 lines
476 B
C++
30 lines
476 B
C++
/* Conformance Test 15.9.0.1: Verification of atof, atoi, atol functions */
|
|
|
|
#include <stdlib.h>
|
|
|
|
main ()
|
|
{
|
|
double d1;
|
|
int i;
|
|
long L;
|
|
|
|
|
|
d1 = atof ("3.5e-22");
|
|
if (d1 != (double)3.5e-22)
|
|
goto Fail;
|
|
|
|
i = atoi ("-32765");
|
|
if (i != -32765)
|
|
goto Fail;
|
|
|
|
L = atol ("100000");
|
|
if (L != 100000)
|
|
goto Fail;
|
|
|
|
printf ("Passed Conformance Test 15.9.0.1\n");
|
|
return;
|
|
|
|
Fail:
|
|
printf ("Failed Conformance Test 15.9.0.1\n");
|
|
}
|