Convert double between Big-Endian and Little-Endian
Convert double between Big-Endian and Little-Endian
- Subject: Convert double between Big-Endian and Little-Endian
- From: Gu Bin <email@hidden>
- Date: Fri, 10 Feb 2006 20:33:44 +0800
Hello, I have to read a table of double numbers stores in a file(Little-Endian), And i am not sure whether there is some better ways to convert them into Big-Endian. I code in this way, but it seems rather strange(though, it works)
CFSwappedFloat64 swappedNum = CFConvertDoubleHostToSwapped (doubleNum); swappedNum.v = CFSwapInt64(swappedNum.v); doubleNum = CFConvertDoubleSwappedToHost(swappedNum);
By the way, what's the difference between "CFSwapInt32LittleToHost" and "EndianS32_LtoN"? :) |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden