[Issue 9742] New: std.math.floor returns 0 for any value x > -1 and x < 0

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 17 11:39:27 PDT 2013


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

           Summary: std.math.floor returns 0 for any value x > -1 and x <
                    0
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2013-03-17 11:39:26 PDT ---
The documentation says that std.math.floor

Returns the value of x rounded downward to the next integer (toward negative
infinity).

But it returns 0 for any value x > -1 and x < 0. This used to work correctly in
earlier versions of phobos.

Repro case:

import std.math;
import core.stdc.stdio;

void main(string[] args)
{
    assert(std.math.floor(-0.002f) == -1.0f);
}

-- 
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