From: Paul A. Bristow (boost_at_[hidden])
Date: 2001-09-12 14:43:16
Fine by me - but that is a detail that needs deciding/documenting
about future boost math functions.
I am still not clear how best to provide a PORTABLE NaN test. Ideas
if (x != x) test doesn't work for me on MSVC, but they do provide _isnan.
so a macro test could switch, but what do other platforms do?
if (x != x) test doesn't feel nice to me.
Should NaN testing be the subject of a separate BOOST /Standard work?
(It SHOULD be very widely used? But isn't because it doesn't work well?)
Dr Paul A Bristow, hetp Chromatography
LA8 8AB UK
+44 1539 561830
Mobile +44 7714 33 02 04
> -----Original Message-----
> From: jmaurer [mailto:jmaurer]On Behalf Of Jens Maurer
> Sent: Tuesday, September 11, 2001 8:55 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Re: Math Functions
> "Paul A. Bristow" wrote:
> > Attached is a tranlsation of ACM TOMS 715.f ANORM into C++.
> > It does the normal distribution function.
> > (NOT yet Boostified before anyone comments!)
> > (prob.cpp is the function, prob.h just declares it, test.cpp
> > and its results in a .txt file (also pasted into the prob.cpp
> > at the end)
> I'd expect that the case
> if (x > 8.572)
> should return 1, not 0.
> The normal distribution is defined for all (real) arguments
> x, therefore its domain is easy.
> > I see no reason why an exception should be raised if the argument falls
> > outside the values, as the value 0 or 1 should be returned.
> Yes, the function is mathematically defined for all (real)
> arguments. An IEEE-aware implementation should probably check
> for x == NaN and short-circuit that case.
> > Cody says:
> > C Error returns
> > C The program returns ANORM = 0 for ARG .LE. XLOW.
> Not an error, just a normal result.
> > but I don't see (as a mad scientist and not a mad mathematican)
> > why this is an error or needs flagging, except that the result
> > might be denormalised
> What's wrong with the result being denormalized?
> Jens Maurer
> Info: http://www.boost.org Unsubscribe:
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk