printf %.02E

bridged with qnx.development_tools
Post Reply
Oklapek Marian

printf %.02E

Post by Oklapek Marian » Tue Jul 25, 2006 6:00 am

Hello,

I have problem with display float value in function printf with format
"%.02E", "%.10E" ... ( +8 )

float F = 8.00E-06;
Result is
printf( "%.01E", F ); 8.0E-06
printf( "%.02E", F ); 7.99E-06
printf( "%.03E", F ); 8.000E-06

Round with format "%.02E" dos not work correct. Result should be
8.00E-06 and not 7.99E-06
It looks like bug in libc module xldtob.c function _Ldtob.
In line 125 is not correct initialized value gen for format e and E. (I
have look on cvs.qnx.com)

Of course I can solve this problem with format "%#.03G"

I am using QNX 6.3 SP1. My be it is known bug repaired in new version.
If not can somebody repair it ?

Thanks
Marian

Post Reply

Return to “qnx.development_tools”