When using a 64-bit architecture, Mac OS X uses 32 bit integers, but 64 bit longs. NSInteger is defined as a long for 64, not an integer.

When running 64-bit, you need to use %ld as the format option.

Try this and see if it works any beter:

        NSInteger d = [@"43253234929732" integerValue];
        NSLog(@"%qi, %ld", (long)d, (long)(d%2));

Good Luck -
Jon Hess

On Mar 7, 2009, at 5:41 PM, Sean McBride wrote:

Dave DeLong ([email protected]) on 2009-03-07 7:55 PM said:

I'm on a 2GHz Macbook Unibody, so I'm expecting that d is a 64-bit
integer.

Don't expect, measure.  What does sizeof(d) give?

Also, if you want a 64 bit integer, use int64_t. NSInteger changes size
depending, as others have said.

Sean


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jhess%40apple.com

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to