[Issue 4409] New: to!double("-nan") throws

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 30 07:32:12 PDT 2010


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

           Summary: to!double("-nan") throws
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-06-30 07:32:09 PDT ---
import std.conv;

void main() {
    auto foo = to!double("nan");  // Works
    auto bar = to!double("-nan"); // Throws
}

std.conv.ConvError: std.conv(659): Can't convert value `-nan' of type
const(char)[] to type double

It's important that the string "-nan" get converted properly to a NaN so that
floating point numbers output to strings by writeln() can be read back
properly.

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