Phobos unit testing uncovers a CPU bug

bearophile bearophileHUGS at lycos.com
Fri Nov 26 15:06:42 PST 2010


%u:

> Slightly related, do you have some code to convert a hex float string to float?

This doesn't work, but it's supposed to work. Add this to bugzilla if it's not already present:

import std.conv: to;
void main() {
    auto r = to!real("0x1.0076fc5cc7933866p+40L");
    auto d = to!double("0x1.0076fc5cc7933866p+40L");
    auto f = to!float("0x1.0076fc5cc7933866p+40L");
}


> Regarding unit tests, I should really use them :(

Yep, and DbC too, and compile your D code with -w.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list