[Issue 9955] New: std.math.feqrel for numbers close to zero

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 18 04:46:12 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9955

           Summary: std.math.feqrel for numbers close to zero
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-04-18 04:46:11 PDT ---
I think feqrel is not working well when numbers are close to 0.0:


import std.stdio: writeln;
import std.math: feqrel;
void main() {
    feqrel(1.000000000000001, 1.0).writeln;
    feqrel(1.00000000001, 1.0).writeln;
    feqrel(1.1, 1.0).writeln;

    feqrel(0.000000000000001, 0.0).writeln;
    feqrel(0.00000000001, 0.0).writeln;
    feqrel(0.1, 0.0).writeln;
}


Prints, dmd 2.063alpha:

50
37
4
0
0
0

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list