
26 Jan
2009
26 Jan
'09
6:44 p.m.
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 :|
But the IEEE spec says that every integer less than 2^24 can be exactly represented as a single precision floating point number... (http://en.wikipedia.org/wiki/Floating_point) So, I am still confident that converting integers greater that 2^24 to float using boost::numeric_cast must raise an exception. Has this behavior changed in the newer versions of Boost? Best. -- Hermann Rodrigues hermann@csr.ufmg.br Centro de Sensoriamento Remoto / UFMG http://www.csr.ufmg.br/dinamica