Re: Q: Portable Ada floating-point binary I/O ?



Gautier <gautier@xxxxxxxxxxxxxxx> 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
.