|
Boost Users : |
Subject: Re: [Boost-users] [conversion] Using Lexical_cast to convert string to float
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-06-10 02:32:09
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. Is this what lexical_cast does internally?
Ryan
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