Bug 4409 – to!double("-nan") throws

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-06-30T07:32:00Z
Last change time
2010-08-11T13:58:44Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-06-30T07:32:09Z
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.
Comment #1 by dsimcha — 2010-08-11T13:58:44Z
This appears to have been fixed in 2.048. Must be related to the revamp of std.conv.