Boost logo

Boost Users :

Subject: Re: [Boost-users] [conversion] Using Lexical_cast to convert string to float
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-10 10:17:45


AMDG

Ryan McConnehey wrote:
> Steven Watanabe wrote:
>> The problem is in the standard library. (Tested with msvc 9.0
>> express--gcc 4.3.0 behaves sensibly).
> So, Microsoft's implementation is off? It wouldn't be that surprising
> though. :-)
>> ss: true, val: 1.#INF
>> ss: false, val: -9.25596e+061
> It looks like the "3.4e350" gets converted to a valid value (for
> doubles) and the only way to determine if it was out of range is to do
> a cast on the stream itself.

There are no guarantees about what val holds.

> Is this what lexical_cast does internally?

Yes.

In Christ,
Steven Watanabe


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