digitalmars.D.bugs - [Issue 16026] New: std.math.frexp!float() wrong for very small
- via Digitalmars-d-bugs (30/30) May 15 2016 https://issues.dlang.org/show_bug.cgi?id=16026
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 puremagic.com Reporter: thomas.bockman 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? --
May 15 2016