
Hi,
I always thought that the conversion from int to float could raise an exception when the int can not be properly represented as a float.
Well, in this case, even casting 2 should raise an exception :|
However, this is not what I am gettingn in version 1.33.1. For example, in my opinion, casting -2147483647 to a float should be raising an exception but boost::numerical_cast always says that the conversion is valid and well-formed.
Obviously, my boost version is a little outdated, but I can not upgrade at this time due to several constraints.
My question is: is this behavior either a bug (even in newer versions of boost) or a feature?
It's more the consequences of the IEEE float representation. Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher