[Issue 4959] New: std.conv.parse error "no digits seen" on string starting with zero

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 30 06:24:36 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4959

           Summary: std.conv.parse error "no digits seen" on string
                    starting with zero
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bugzilla at kyllingen.net


--- Comment #0 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2010-09-30 06:24:18 PDT ---
Test case:

  auto s = "0 ";
  auto f = parse!double(s);  // std.conv.ConvError: no digits seen

The problem is that when the string starts with '0', parse() skips that char to
check if the next one is 'x' (to determine whether it's a hex number).  When it
is not a hex number, like in the example above, the zero is simply discarded.

-- 
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