tonnot
13th May 2011, 19:18
I have :
signed short int my_i // -32768 to 32767
std::istringstream i(value);
i>>my_i
Ok, if I pass value "38000" my_i gives me -27536
Ok, if I pass value "-27536" my_i gives me -27536
So the instruction to know if can be posible to convert to My_i does not fails.
if (!(i >> My_i) )
for the value "38000" 'i' have not to convert, it should to fail, but it works ... converting 38000 to -27536 )
In this situation I can't have the correct value.
Any help ? Maybe mingw the guilty ?
Thanks
signed short int my_i // -32768 to 32767
std::istringstream i(value);
i>>my_i
Ok, if I pass value "38000" my_i gives me -27536
Ok, if I pass value "-27536" my_i gives me -27536
So the instruction to know if can be posible to convert to My_i does not fails.
if (!(i >> My_i) )
for the value "38000" 'i' have not to convert, it should to fail, but it works ... converting 38000 to -27536 )
In this situation I can't have the correct value.
Any help ? Maybe mingw the guilty ?
Thanks