[Issue 7691] New: A pure std.math.floor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 11 14:12:27 PDT 2012


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

           Summary: A pure std.math.floor
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-03-11 14:12:35 PDT ---
import std.math: floor;
pure void main() {
    enum double x = floor(2.3);
}


DMD 2.059head gives:

test.d(3): Error: pure function 'main' cannot call impure function 'floor'
...\dmd2\src\phobos\std\math.d(1917): Error: floorl cannot be interpreted at
compile time, because it has no available source code
test.d(3):        called from here: floor(2.3L)


So there are two problems here, floor is not pure and it can't run at
compile-time.

std.math.fmod() too isn't pure.

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