[Issue 16026] New: std.math.frexp!float() wrong for very small subnormal values

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 15 03:04:23 PDT 2016


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

          Issue ID: 16026
           Summary: std.math.frexp!float() wrong for very small subnormal
                    values
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: thomas.bockman at gmail.com

import std.math, std.traits, std.stdio;

T test(T)()
    if (isFloatingPoint!T)
{
    int exp;
    return frexp(3 * (T.epsilon * T.min_normal), exp);
}

void main() {
    writeln(test!real()); // 0.75
    writeln(test!double()); // 0.5?? (But 0.75 on GDC.)
    writeln(test!float()); // 0.5?? (But 0.75 on GDC.)
}
---
I tried tracking this down myself in the std.math code, but I couldn't find
anything wrong. Maybe it's a codegen bug?

--


More information about the Digitalmars-d-bugs mailing list