Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!noose.ecn.purdue.edu!news From: luj@gus16.ecn.purdue.edu (Jun Lu) Newsgroups: comp.unix.questions Subject: passing floats in inet socket-based IPC Message-ID: <1990Nov26.041459.26699@noose.ecn.purdue.edu> Date: 26 Nov 90 04:14:59 GMT Sender: news@noose.ecn.purdue.edu (USENET news) Distribution: na Organization: Purdue University School of Aeronautics and Astronautics Lines: 22 Is there a quick/neat way to passing floats in inet socket-based IPC, just like we "routinely" do for passing ints on "popoular" architectures( with just some hton or ntoh conversions) ? The two processes, as indicated by "inet", may run on two different plateforms. One very portable and safe way for passing floats is, as I can see, is to convert floats to ascii representations before sending them across the network and on the other end convert the ascii strings back to floats using strtod(). But the disadvantages are that this consumes more message space than necessary and also incurs the overhead of converisons between ascii and floats. Are the any better alternatives ? Thanks for any info/pointers in advance. -- -- Jun Lu Internet:luj@ecn.purdue.edu -- -- Aeronautics & Astronautics Bitnet: luj%ecn.purdue.edu@purccvm -- -- Purdue University UUCP: pur-ee!luj -- -- W. Lafayette, IN 47907 Phone:317-494-9410 Fax:317-494-0307 --