Bug 3369 – std.conv.to!(float/double/real) doesn't work w/ infinity.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-10-06T14:11:00Z
Last change time
2015-06-09T01:29:41Z
Assigned to
andrei
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2009-10-06T14:11:11Z
import std.conv, std.stdio;
void main() {
writeln(to!float("inf"));
}
Results in the following runtime error:
std.conv.ConvError: Can't convert value `inf' of type const(char)[] to type float
If I change to "-inf" or try to convert to double or real instead of float, nothing changes.
Comment #1 by andrei — 2011-01-08T23:00:55Z
Revision 2285
Comment #2 by k.hara.pg — 2011-08-09T19:07:34Z
*** Issue 5811 has been marked as a duplicate of this issue. ***