Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: passing floats in inet socket-based IPC Message-ID: <14620@smoke.brl.mil> Date: 30 Nov 90 10:46:14 GMT References: <1990Nov26.164122.6152@noose.ecn.purdue.edu> <1990Nov29.224651.26522@zoo.toronto.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 11 In article <1990Nov29.224651.26522@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: >In article <1990Nov26.164122.6152@noose.ecn.purdue.edu> luj@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.