Le jeudi 25 janvier 2007 à 10:25 +0100, Tobias Munk a écrit :
I am using a custom rounding policy for transcendental functions, based on crlibm and defined in the manner of
libs/numeric/interval/examples/transc.cpp
In the documentation of crlibm, it is recommended to call the init function crlibm_init() before calling one of their transcendental functions. My question now is: does anybody know if calling this init function collides with any of the boost.numeric.interval internal algorithms?
If you are using crlibm functions outside of the interval functions, you can use a single crlibm_init for your whole program, as the interval functions do not assume anything about the state of the floating-point unit. Interval functions, however, relies on a special rounding mode. So, at the entry points of your policy, the rounding mode may not be what crlibm expects, so crlibm_init has to be called in your policy functions. And you have to call crlibm_exit to restore the rounding mode before they return, as the interval computations may not be finished yet. Best regards, Guillaume