#724: [bug] Parrot fails numeric conversion of ucs2 strings
----------------------+-----------------------------------------------------
Reporter: pmichaud | Owner:
Type: bug | Status: reopened
Priority: normal | Milestone:
Component: core | Version: 1.2.0
Severity: medium | Resolution:
Keywords: | Lang:
Patch: | Platform:
----------------------+-----------------------------------------------------
Comment(by doughera):
Replying to [comment:5 particle]:
> Replying to [comment:4 bacek]:
> > Branch (misnamed) tt24_unicode_numification) ready for merge. Only one
concern: we never declared format for "NaN", "Inf" and "-Inf". Old version
based on atof supported some bizzare variants like " nAn", " inF" and "
InFiNity". Version in branch support only canonical "Inf", "-Inf" and
"NaN". Question is - should I mimic atof behaviour or we can declare
standard format for it?
> >
> the canonical representation for NaN and Inf are 'NaN' and 'Inf'. other
variants of capitalization or spelling are not valid; they must be
converted to the format above. don't mimic the old atof behavior.
>
I haven't followed this branch at all, so this may be irrelevant.
Where are the strings coming from? Are they coming from the outside
world? If so, it would be better to ignore case, as strtod() does (if it
handles NaN and Inf at all.) Note that the printf in Linux glibc prints
'nan' and 'inf'. It seems to me this is a sensible place to apply the "Be
liberal in what you accept, and conservative in what you send" principle.
One other thing: Don't forget -NaN.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/724#comment:9>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets