Precision of variables

Hello,

I am writing a program to calculate Newtons Method and I want to use 10^-6 (0.000001) as my epsilon. I have defined epsilon as a double precision floating point number but it is printing out as 1e-06 and I think it is affecting my later calculations. It seems my program will only print out up to 5dp .How can I change this?

Thanks

hawaiianair
Last edited on
http://floating-point-gui.de/

You'll probably lose precision over time anyway, so if you want to have maximum precision, then you should collect variables in their beginning form, and calculate them all at the end(so you could store them as a string, for example).

Cheers!
Last edited on
1e-06 is the same as 10^-6.
Topic archived. No new replies allowed.