Boost logo

Boost Users :

Subject: Re: [Boost-users] Numeric_cast from int to float
From: Matthieu Brucher (matthieu.brucher_at_[hidden])
Date: 2009-01-26 14:13:57


> 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?

 To be more accurate, this would mean testing the value in the
numerical cast, as there are no ASM instruction to do this on the
usual platforms. The cost that this would induce is probably too high
a price to pay. I think the best course of action would be to write
your own cast for this specific use.

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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net