20 May 19:01
Re: [math] pow redux and observations
John Maddock <john <at> johnmaddock.co.uk>
2008-05-20 17:01:14 GMT
2008-05-20 17:01:14 GMT
Bruno Lalande wrote: > Hello, > >> Actually, a rationale could be provided for pow<0>(0) == 1. But it >> should be explained in the documentation. Alternatively, you could >> use a policy class, I suppose. Either way, pow<0> should probably >> be handled as a special case, not in positive_power. > > As returning 1 makes sense in most cases, I'd be inclined to simply > state this behavior in the doc. > > We can use policies, but in this case I vote for having 2 different > policies for negatives powers of 0 and 0^0, with throw_on_error as a > default for the first one and ignore_error (namely: return 1) for the > second one. Bruno, ping me if you need any help adding new policies to the existing framework. Do you have Sandbox SVN commit access BTW? Let me know if not and I'll sort that out as well (the procedure I've been testing out with this library is to make all substantive changes to the Sandbox version and only trivial fixes to Trunk and then periodically synchronise the Trunk and Sandbox versions). Cheers, John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
RSS Feed