From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Q: Portable Ada floating-point binary I/O ?
Date: Sat, 26 Aug 2006 22:42:04 +0200
Date: 2006-08-26T22:41:46+02:00 [thread overview]
Message-ID: <nae24r4toni2.1tmzdp70veqmf$.dlg@40tude.net> (raw)
In-Reply-To: 44f09ac3$1_3@news.bluewin.ch
On Sat, 26 Aug 2006 21:02:47 +0200, Gautier wrote:
> Does somebody know about a way of doing floating-point I/O which
> is portable across architectures (endianesses etc.) and a little
> bit more compact than the representation with digits ?
For network communications we send binary exponent and mantissa as signed
integers and then assemble them using corresponding floating-point
attributes. Integers are sent in a variable length format, which along with
a moderate compression effect, allows us to vary the mantissa length. So it
becomes independent on how many bits the mantissa has on the given host.
However, the problem is - what does "portable" mean here? Range and
precision cannot be portable, unless types aren't communicated as well.
> If yes, is there an open-source Ada package doing it ?
Alas, it isn't. But it is easy to implement.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2006-08-26 20:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-26 19:02 Q: Portable Ada floating-point binary I/O ? Gautier
2006-08-26 20:42 ` Dmitry A. Kazakov [this message]
2006-08-27 20:34 ` Gautier
2006-08-28 11:55 ` Stephen Leake
2006-09-04 22:18 ` Gautier
2006-08-29 2:03 ` Steve
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox