log2 buggy or is a real thing?

bearophile bearophileHUGS at lycos.com
Wed Apr 4 04:46:12 PDT 2012


Do you know why is this program:

import std.stdio;
void main() {
    real r = 9223372036854775808UL;
    writefln("%1.19f", r);
}

Printing:
9223372036854775807.8000000000000000000

Instead of this?
9223372036854775808.0000000000000000000

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list