>>
>> IEEE 754 floats always in the same order.
>>
>> p = 2.71828;
>> fprintf (stdout, "%x", *(unsigned long *)&p);
>>
>> Produces 402df84d on both my PPC and Intel Mac.
>
> Of course it does. Both long and float use the same byte order within
> the same CPU. That's all your test shows. Try doing this:
>
> float p = 2.71828;
> char *ptr = (char *)&p;
> printf("%02x%02x%02x%02x", ptr[0], ptr[1], ptr[2], ptr[3]);
>
> You will see reversed results between machines.
>

Of course! What was I thinking . . .
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to