Boost logo

Boost :

From: Johan Råde (rade_at_[hidden])
Date: 2008-01-07 13:26:30


frederic.bron_at_[hidden] wrote:
>
> it would be really portable if you dealt with the representation of the exponent in scientific notation
> because this is not clearly stated in the standard (i.e. the number of digits of the exponent is greater or equal to 2 but some compiler write 2 and some others 3 which makes non portable outputs).
> example: 1.0e+003 or 1.0e+03.

Portability of formatting and parsing means that output that has been formatted by one
implementation of the standard library can be parsed by other implementations of the standard library.
Hence, as long as all implementations of the standard library can parse both 1.0e+003 or 1.0e+03
there is no portability issue here.

The representation of infinity and NaN is a more serious matter.
Some implementations of the standard library do format them in a way
that other implementations can not parse.
This can for instance cause deserialization of text archives to crash.

--Johan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk