[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Floating point problems



try the following 
 main() {
       double x = 1.0;
       double y = 1e-155;

       x *=(1e-155*y);
       printf("%e %e %e\n",(1e-155*y),x,1e-310);
 }

this generates the same result as the original program but will not cause a 
trap.


Alvin Starr                   ||   voice: (416)585-9971
Interlink Connectivity        ||   fax:   (416)585-9974
alvin@iplink.net              ||



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []