Boost logo

Boost :

From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2008-05-26 16:28:45


Hi John,

I've committed the new implementation in the sandbox, and began to see
how to handle the 0^0 case. I'm going to need help, because things are
not exactly how I thought they were.

As I said, what I'd like is to have a default behavior that returns 1.
I thought I could use the already existing ignore_error policy but I
realize its behavior is imposed by the framework. For domain_error,
which is the policy that best fits the 0^0 case IMO, ignore_error
returns quiet_NaN which is not what I want. I can't use a user_error
either since it would force me to predefine the user_domain_error
function, thus stealing this point of customization to the user. So
I'm realizing I'll have to adapt the framework (that's probably what
you meant the other day by "adding new policies", I didn't notice at
that moment).

I don't know Boost.Math policies very much but my understanding is
that we don't need a new policy but just a new action type, that I
could use to return 1. I see 2 possibilities: creating a brand new
action type, or allowing the existing "ignore_error" action to take in
its constructor the value that we want it to return in place of
quiet_NaN.

Or maybe you prefer to simply return quiet_NaN instead of 1? Note that
it's not the behavior of the C pow function so it could be misleading
for users.

What do you think about that?

Thanks
Bruno


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk