[Issue 13369] std.math.iLog10

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 25 01:40:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13369

--- Comment #1 from bearophile_hugs at eml.cc ---
An example of the risks of using ceil(log10):


void main() {
    import std.stdio, std.math;
    immutable x = 10 ^^ 7;
    writefln("%1.20f", x.log10);
    writeln(x.log10.ceil);
}


Output:
7.00000000000000000040
8

--


More information about the Digitalmars-d-bugs mailing list