passing floats in inet socket-based IPC

Doug Gwyn gwyn at smoke.brl.mil
Fri Nov 30 21:46:14 AEST 1990


In article <1990Nov29.224651.26522 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
>In article <1990Nov26.164122.6152 at noose.ecn.purdue.edu> luj at delta.ecn.purdue.edu (Jun Lu) writes:
>>Is there a quick/neat way to passing floats in inet socket-based IPC, just
>>like we "routinely" do for passing ints on "popular" architectures( with
>>just some hton or ntoh conversions) ?
>In a word, no.  There is too much diversity in floating-point formats to
>admit of any graceful general solution that's also quick and simple.

What I do is to split the float into integral exponent and significand,
using the UNIX library functions that support that (frexp et al.).
There are some details to be considered but that's the essence.



More information about the Comp.unix.questions mailing list