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

Reply via email to