question on wrong result for small numbers from strtod(), strtof()

Daniel Calcoen Daniel.Calcoen@cern.ch
Tue Oct 26 10:23:00 GMT 2010


I checked twice that the patch was correctly applied, I rebuild newlib and
run the test

This is not the correct patch, now I have more wrong values [tests
4,5,12,13,14,18,19 and 20]

Here you have the test, values and results

/*  0 */    {"1"},
   rx610_fp32	1
   rx610_fp64	1
   errno_tod	0
   errno_tof	0
/*  1 */    {"10.0"},
   rx610_fp32	10
   rx610_fp64	10
   errno_tod	0
   errno_tof	0
/*  2 */    {"666.666"},
   rx610_fp32	666.666	
   rx610_fp64	666.666	
   errno_tod	0	
   errno_tof	0	
/*  3 */    {"-666.666"},
   rx610_fp32	-666.666
   rx610_fp64	-666.666
   c6727_fp32	0      	
   c6727_fp64	0      	
   errno_tod	0	
   errno_tof	0	
/*  4 */    {"+1.23456789E+12"},
   rx610_fp32	1.234567e+010
   rx610_fp64	1.234567e+010
   errno_tod	0
   errno_tof	0	
/*  5 */    {"-1.23456789E-12"},
   rx610_fp32	-1.234567e-014
   rx610_fp64	-1.234567e-014
   errno_tod	0
   errno_tof	0
/*  6 */    {"1.7976931348623157E+308"},
   rx610_fp32	1.#INF 
   rx610_fp64	1.#INF 
   errno_tod	34	
   errno_tof	34	
/*  7 */    {"1.7976931348623156E+308"},
   rx610_fp32	1.#INF 	
   rx610_fp64	1.#INF
   errno_tod	34	
   errno_tof	34	
/*  8 */    {"1.7976931348623156E+307"},
   rx610_fp32	1.#INF 
   rx610_fp64	1.#INF 
   errno_tod	34	
   errno_tof	34	
/*  9 */    {"2.2250738585072014E-308"},
   rx610_fp32	0  
   rx610_fp64	0  
   errno_tod	34
   errno_tof	34
/* 10 */    {"2.2250738585072013E-308"},
   rx610_fp32	0  
   rx610_fp64	0  
   errno_tod	34
   errno_tof	34
/* 11 */    {"2.2250738585072013E-307"},
   rx610_fp32	0 
   rx610_fp64	0 
   errno_tod	34	
   errno_tof	34	
/* 12 */    {"3.40282347E+38"},
   rx610_fp32	3.402823e+036	
   rx610_fp64	3.402823e+036	
   errno_tod	0	
   errno_tof	0	
/* 13 */    {"3.40282346E+38"},
   rx610_fp32	3.402823e+036	
   rx610_fp64	3.402823e+036	
   errno_tod	0	
   errno_tof	0	
/* 14 */    {"3.40282346E+37"},
   rx610_fp32	3.402823e+035
   rx610_fp64	3.402823e+035
   errno_tod	0
   errno_tof	0
/* 15 */    {"1.17549435E-38"},
   rx610_fp32	0
   rx610_fp64	0
   errno_tod	34
   errno_tof	34
/* 16 */    {"1.17549434E-38"},
   rx610_fp32	0
   rx610_fp64	0
   errno_tod	34
   errno_tof	34
/* 17 */    {"1.17549434E-37"},
   rx610_fp32	1.175494e-037
   rx610_fp64	1.175494e-037
   errno_tod	0	
   errno_tof	0	
/* 18 */    {"1.17549434E+35"},
   rx610_fp32	1.175494e+033
   rx610_fp64	1.175494e+033
   errno_tod	0
   errno_tof	0	
/* 19 */    {"1.17549434E+36"},
   rx610_fp32	1.175494e+034
   rx610_fp64	1.175494e+034
   errno_tod	0
   errno_tof	0
/* 20 */    {"-1.2345678e39"},
   rx610_fp32	-1.23456e+037	
   rx610_fp64	-1.23456e+037	
   errno_tod	0
   errno_tof	0
/* 21 */    {"8.7654321e-45"},
   rx610_fp32	0 
   rx610_fp64	0 
   errno_tod	34
   errno_tof	34
/* 22 */    {"1.2345678e-42"}
   rx610_fp32	0 
   rx610_fp64	0 
   errno_tod	34
   errno_tof	34


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5478 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20101026/e659ba7b/attachment.bin>


More information about the Newlib mailing list