[Issue 5280] New: to!FP(Hex float string) doesn't work well
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Nov 26 15:10:57 PST 2010
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 at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-11-26 15:09:33 PST ---
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: -------
More information about the Digitalmars-d-bugs
mailing list