Subject: Re: floats across the network
To: Michael Richardson <>
From: Frank van der Linden <>
List: tech-net
Date: 08/07/2002 23:25:32
On Wed, Aug 07, 2002 at 05:12:20PM -0400, Michael Richardson wrote:
>   I thought that float representation varried rather a lot between
> processors. The number of bits of mantissa, etc.

You can use XDR functions (xdr_float, xdr_double) to send and
receive floats. XDR was invented for RPC, but you can also use
the functions seperately.

Distributed computing software sometimes uses that stuff (e.g.
PVM used it). If there are wildly different formats from machine
to machine, you should expect some precision lossage, of course.
But it's not so bad for 'modern' machines.

- Frank

Frank van der Linden                          
Quality NetBSD Development, Support & Service.