From: David M. C. <co...@ph...> - 2006-09-04 20:29:09
|
On Mon, 4 Sep 2006 01:53:40 -0400 "A. M. Archibald" <per...@gm...> wrote: > > A better question to ask is, "Can I change numpy's rounding behaviour > for my programs?" (And, more generally, "can I set all the various > floating-point options that the IEEE standard and my processor both > support?") I don't know the answer to that one, but it does seem to be > a goal that numpy is trying for (hence, for example, the difference > between numpy float scalars and python floats). (looks) I think we've missed rounding. And the inexact flag. You can control how overflow, underflow, divide-by-0, and invalid-operand are handled using geterr and seterr, though. Unfortunately, getting/setting the rounding mode is hard to do in a platform-independent way :( gcc has fegetround() and fesetround() (they're part of the C99 standard, I believe). I don't know what to use on other machines (esp. Windows with MSVC), although the Boost Interval library looks like a good place to start: http://boost.cvs.sourceforge.net/boost/boost/boost/numeric/interval/detail/ -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |