Weird of the week: NSXMLElement writes out numbers oddly in exponential form (35 → 3.5E1).
Related: Apple Support: ‘Open Firmware: Password Not Recognized When It Contains the Letter “U”‘. (”Solution: Don’t use a capital letter “U” when setting up an Open Firmware password.”)
I’m pretty sure 35 is not an even number.
By Peter Hosey · 2007.05.23 22:08
Well, blame me not: link says “NSXMLElement stores wrong value for even numbers”.
By Jesper · 2007.05.23 23:20
But the problem isn’t that it’s stored in exponential format—all numbers are, as shown in the article. That’s somewhat weird, but not broken in and of itself.
The problem is that when the number to be stored is even, it stores an incorrect value. It stores 35 as 3.5e1, which is correct (3.5e1 = 35.0), but it stores 30 as 30e1, which is wrong (30e1 = 300.0).
By Peter Hosey · 2007.05.24 00:16
As I just told Peter: the point was that the number was spit out in exponential format, NOT that they calculated incorrectly. I didn’t even pay attention to that originally – I thought it only printed odd numbers out exponentionally, even, thus the title of this post.
It’s still really odd, though, so the post stays.
By Jesper · 2007.05.26 22:27