Subject: Re: floats across the network
To: Michael Richardson <mcr@sandelman.ottawa.on.ca>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-net
Date: 08/07/2002 23:29:08
On Wed, Aug 07, 2002 at 05:12:20PM -0400, Michael Richardson wrote:
> 
> >>>>> "David" == David Laight <david@l8s.co.uk> writes:
>     >> I am having a doubt whether on sending between
>     >> little endian and big endian machines floats have also
>     >> to be converted like int (ntohl) or they are not to be
>     >> converted.
> 
>     David> They will almost certainly need to be converted.
>     David> In many cases reversing all the bytes will suffice,
>     David> however some architectures (eg arm) use a mixed
>     David> byte ordering for floats, others may use a non-standard
>     David> encoding.
> 
>   I thought that float representation varried rather a lot between
> processors. The number of bits of mantissa, etc.

using XDR routines will help, if you want a ready to use solution.

	-is

-- 
seal your e-mail: http://www.gnupg.org/