comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Q: Portable Ada floating-point binary I/O ?
Date: Mon, 28 Aug 2006 07:55:12 -0400
Date: 2006-08-28T07:55:12-04:00	[thread overview]
Message-ID: <ud5alyt0f.fsf@stephe-leake.org> (raw)
In-Reply-To: 44f201b0$1_6@news.bluewin.ch

Gautier <gautier@fakeaddress.nil> writes:

>  > However, the problem is - what does "portable" mean here? Range and
>  > precision cannot be portable, unless types aren't communicated as well.
>
> In my case, it should not be a problem; I have a deterministic file
> format with some items expected as GL.Double, others as GL.Float. I
> just want to ensure that the same file will be correctly read by a PC,
> a Mac or a Playstation.

Those are all IEEE hardware, so all you need is byte-endianness
conversions. See SAL http://stephe-leake.org/ada/sal.html for that, in
particular sal-endianness_gnat_x86.ads, sal-network_order.ads, and
sal-math_float-network_order.ads.

-- 
-- Stephe



  reply	other threads:[~2006-08-28 11:55 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
2006-08-27 20:34   ` Gautier
2006-08-28 11:55     ` Stephen Leake [this message]
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