[Issue 5280] to!FP(Hex float string) doesn't work well

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 9 12:00:43 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=5280


hsteoh at quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh at quickfur.ath.cx


--- Comment #1 from hsteoh at quickfur.ath.cx 2013-12-09 12:00:39 PST ---
This bug seems to have changed since the past 3 years. Now the code prints this
error at runtime:

std.conv.ConvException@/usr/src/d/phobos/std/conv.d(1804): Unexpected 'L' when
converting from type string to type real

Removing the trailing 'L' from the input strings makes the conversion work
successfully for all 3 floating types.

I'm not sure if this should still be considered a bug, since technically the
'L' is specific to D's literal syntax, and shouldn't be part of a general
floating-point parsing format? Or should std.conv be changed to understand the
'L'? (Seems a bit pointless, since the template argument to to() already tells
whether the literal is intended to be long or not.)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list