numeric_cast<float> throws for double infinity
9 Mar
2016
9 Mar
'16
2:12 p.m.
When I try to cast variable of type double (which is equal to std::numeric_limits<double>::inifinity()) to float I get exception: std::bad_cast: bad numeric conversion: positive overflow. I expected to get std::numeric_limits<float>::inifinity(). The same is true for negative infinity. Is it intended behavior or bug? In case this should be considered as bug, maybe it was fixed in more recent versions of Boost? PS. I am using stock Boost 1.54 on Ubuntu 14.04 Regrads, Dmitry.
3185
Age (days ago)
3185
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitry Volosnykh