Division - precision
Era Scarecrow via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat May 21 15:36:49 PDT 2016
On Saturday, 21 May 2016 at 21:45:19 UTC, Rygel wrote:
> Hi there. I'm a beginners, so my questions could be silly.
>
> double x1 = 7.0;
> double x2 = 3.0;
> writeln(x1 / x2);
>
> this is ok but how can i get more digits? For example:
>
> 2.333333333.....
I'm not sure how to globally set the number of output
characters, but you can force it with formatting.
writefln("%.10g", x1 / x2); //floating point with 10 digits of
precision
More information about the Digitalmars-d-learn
mailing list