[MacRuby-devel] Getting a corrupt value reading an NSNumber unsignedLongLongValue
Laurent Sansonetti
lsansonetti at apple.com
Mon Dec 20 13:22:45 PST 2010
Hi Caio,
Excellent! In this snippet, n is a 64-bit bignum, so I suspect something is going wrong in the converter. Could you file a ticket? We will get that fixed for 1.0.
Laurent
On Dec 20, 2010, at 12:49 PM, Caio Chassot wrote:
> On 2010-12-20, at 16:37 , Caio Chassot wrote:
>>
>> Could someone try to reduce this and take the notification center and iTunes out of the picture and see if it's just a problem with NSNumber?
>
> Oh, that was easier than I thought.
>
> #!/usr/bin/env macruby
> n = 0x8C2CACEFCD8BBABA
> m = NSNumber.numberWithUnsignedLongLong n
> puts "%016X" % n
> puts "%016X" % m
> puts "%016X" % m.unsignedLongLongValue
>
> Gives:
>
> 8C2CACEFCD8BBABA
> 0C2CACEFCD8BBABA
> 0C2CACEFCD8BBABA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20101220/2d2ac200/attachment-0001.html>
More information about the MacRuby-devel
mailing list