c - lcc printf floating point -


i have following program:

#include <stdio.h>  int main(int args, char *argv[]) {     printf("%f\n", 0.99999);     printf("%e\n", 0.99999); } 

the result is:

0.009990 9.999900e-001 

why first number wrong? use windows xp, compiler "logiciels informatique lcc-win32 version 3.8. compilation date: nov 30 2012 19:38:03".

that program correct, , output should be:

0.999990 9.999900e-01 

or very similar that.

(you don't use args or argv, , usual name first parameter of main argc rather args, neither of problem should affect program's behavior.)

it looks you've found bug in implementation, in runtime library rather in compiler itself. brief google searches haven't turned reference particular bug (in fact, top hit question).

i suggest contacting maintainer of lcc-win; contact information on web site. short description , link question should provide enough information, @ least start.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -