On 28 September 2012 20:26, Roger Orr <[email protected]> wrote:
>> -----Original Message-----
>> From: Mateusz Loskot [mailto:[email protected]]
>> Sent: 28 September 2012 11:07
>> To: General-purpose list for SOCI users.
>> Subject: Re: [SOCI-users] SOCI // MySQL // failed test case 4
>>
>> > But that's not what we're talking about here.  What Sergei reported is that
>> > MSVC sees a very long number (longer than a double can store) in
>> > std::istringstream's underlying buffer, tries to read a double from this
>> > stream, and instead of putting the stream in failed state puts inf in the
>> > double.  I.e., something like
>> >
>> >     double x;
>> >     std::istringstream
>> > iss("99999999999999999999999912222222222222222222222222223"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333"
>> >
> "9999999999999999999999991222222222222222222222222222333333333333");
>> >     iss >> x;
>> >
>> > With gcc iss.fail() is true after this operation, with MSVC apparently
> it
>> > contains infinity.
>>
>> Aleksander,
>>
>> I missed the point, indeed.
>>
>> That is interesting issue, and I also recall it's MSVC-specific.
>> I always assumed it is related to C99 behaviour of  strtod-like parsing.
>>
>> Curiosity. I may try to ask MS folks about that.
>
> This is an unresolved issue in the C++ standard!
> See http://cplusplus.github.com/LWG/lwg-unresolved.html#1169
>
> 1169. num_get not fully compatible with strto*

Roger, that's of great help. Thank you!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to