Boost logo

Boost Users :

From: Johan Råde (rade_at_[hidden])
Date: 2007-03-17 07:18:07


Robert Ramey wrote:
> Pfligersdorffer, Christian wrote:
>
>> I read this thread with very much interest since I want to use the
>> portable binary archive too. Could you please share your experience
>> and especially the code of the version that actually works?
>
>> Did you also add code to treat floating point types?
>
> Nope - that's an excercise for the user.
> Notes on the current implementation:
>
> b) It doesn't include floating point. I think this would be more
> effort than first meets the eye. At least one attractive proposal on
> how to effectively do this was suggested.

Maybe I should comment on this, since I have been dealing with binary
representation of floating numbers.

Most platforms implement float and double following the IEEE754
standard. (Only exception that I know of is VMS that has an optional VAX
floating point mode.)

Even if we require float and double to follow the IEEE754 standard,
there are still three issues:

1. Endianness.

2. Some platforms support fast IEEE modes with no denormals, no infinity
and no NaN.

3. There is no agreed on standard for long double. What format is used
depends both on the processor and the compiler. I know of at least 4
different binary formats for long double that are commonly used today.

I have no plans to implement floating point support for portable binary
archives, but if someone wants to do it, I would be happy to help with
advice.

--Johan Råde


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net