passing floats in inet socket-based IPC
Jun Lu
luj at delta.ecn.purdue.edu
Tue Nov 27 03:41:22 AEST 1990
I posted the query to comp.unix.questions. I thought that the question may
boil down to the reprsentation of floating point numbers :-( and I like to hear
the comments from the C-gurus. Follow up to comp.unix.questions.
----------
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) ?
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. But the disadvantages are that this consumes more
message space than necessary and also incurs the overhead of converisons
between ascii and floats.
Are there any better alternatives ?
Thanks for any info/pointers in advance.
--
-- Jun Lu Internet:luj at ecn.purdue.edu --
-- Aeronautics & Astronautics Bitnet: luj%ecn.purdue.edu at purccvm --
-- Purdue University UUCP: pur-ee!luj --
-- W. Lafayette, IN 47907 Phone:317-494-9410 Fax:317-494-0307 --
More information about the Comp.lang.c
mailing list