site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com On Apr 24, 2005, at 16:29, Warwick Hall wrote: Newbie question 1: Yes and no. Newbie question 2: HTH. Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large Institute for General Semantics -------- Men are from Earth. Women are from Earth. Deal with it. -------- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... There are ntohl htonl ntohs htons functions that translate between host and network byte order for integer variables. Is there a need to worry about network byte ordering for floating point numbers such as float or double? Yes, because byte-order will certainly affect the value of a bit-string being interpreted as a floating point number. No, because what you are dealing with is a collection of macros used for low-level networking, where floating point numbers don't intrude. If you want to deal with floating point numbers in a higher-level protocol, you are in a pretty hairy problem domain. There are protocols (XDR, associated with Sun RPC, for one; Apollo's work, for another). Also there are commonly defined integer value types like uint32_t or int16_t (usually in stdint.h). Is there a float32_t (for float) or float64_t (for double)? Not really, AFAIK. Floats and doubles tend (in modern chip architectures) to be represented using an IEEE-standard format; so the commonly defined types *are* "float" (single-precision) and "double" (double-precision). These have precise meanings in the standards, and more-or-less common implementation limits in practice. This email sent to site_archiver@lists.apple.com