string to real conversion losing data

Ali Çehreli acehreli at yahoo.com
Thu Apr 8 18:46:57 PDT 2010


Ali Çehreli wrote:

 > Try for example "%.18f" for 'real'.

Well... That will be too many digits unless the number of digits before 
the decimal point is zero.

The decimal digits before and after the point should be 18 for most 
accurate representation. But the OP probably doesn't need that many 
digits anyway.

Here are more options:

   http://digitalmars.com/d/2.0/phobos/std_format.html

Ali


More information about the Digitalmars-d-learn mailing list