Safari and Firefox also seem to return NaN for this. So perhaps the bug in V8 was *not* returning them in the first place, and this is just a (breaking) bug *fix*.
It's interesting that -0xC8 is a valid number in all this JS engines (equivalent to -200), but converting a *string* of that number returns NaN. Anyone have any idea why? Thanks! Aseem On Sat, Jan 26, 2013 at 9:25 PM, Aseem Kishore <[email protected]>wrote: > Hi guys, > > It seems that converting a negative hexadecimal string to a number, using > the unary + operator, has broken in Node 0.9. > > Node 0.4, 0.6, and 0.8: > > > +'-0xC8' > -200 > > Node 0.9: > > > +'-0xC8' > NaN > > Converting positive hexadecimal strings like this continues to work > properly. > > Chrome stable also behaves like this (returning NaN for negative strings), > so I'm guessing this is a V8 issue, but just wanted to share it here too in > case this is known. Is this a by-design change? > > Thanks much! > > Aseem > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
