www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5280] New: to!FP(Hex float string) doesn't work well

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

           Summary: to!FP(Hex float string) doesn't work well
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This code seems correct:


import std.conv: to;
void main() {
    real r0 = 0x1.0076fc5cc7933866p+40L; // OK
    auto r = to!real("0x1.0076fc5cc7933866p+40L");
    auto d = to!double("0x1.0076fc5cc7933866p+40L");
    auto f = to!float("0x1.0076fc5cc7933866p+40L");
}


But DMD 2.050 returns:
std.conv.ConvError: std.conv(723): Can't convert value `L' of type
const(char)[] to type real

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