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

           Summary: Problem with cast -1.0L ==> uint/ulong
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-03-15 11:03:36 PDT ---
This program compiles and runs with no errors, Don and Aldo Nunez think there
are some inconcistancies here:

void main() {
    static assert((cast(ushort)(-1.0L)) == 0xFFFF);
    static assert((cast(uint)(-1.0)) == 0);
    static assert((cast(uint)(-1.0L)) == 0);
    static assert((cast(ulong)(-1.0L)) == 0xbff0000000000000UL);

    assert((cast(ushort)(-1.0L)) == 0xFFFF);
    assert((cast(uint)(-1.0)) == 0);
    assert((cast(uint)(-1.0L)) == 0);
    assert((cast(ulong)(-1.0L)) == 0xbff0000000000000UL);
}


Don>The cast(uint) case is clearly a bug.<

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

Reply via email to