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.
This appears to have been fixed in 2.048. Must be related to the revamp of std.conv.