You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Sébastien Brisard <se...@m4x.org> on 2012/08/20 05:51:14 UTC

[math] Double.NaN or NotStrictlyPositiveException?

Hi,
the current implementation of Gamma.logGamma(double) fails silently when
the argument is not strictly positive, returning Double.NaN.
Previous discussions on this ML show that we all agree (do we?) that
throwing an exception is preferrable. Since I'm reimplementing this
function, I propose to change this behaviour. Do you think that would be
allowed in 3.1?

I do not think it breaks binary compatibility. Neither does it break the
contract of this method, since (quite fortunately) its behavior was not
specified in the Javadoc!

Thanks for your suggestions,
Sébastien

Re: [math] Double.NaN or NotStrictlyPositiveException?

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
On Mon, Aug 20, 2012 at 09:25:46AM +0200, Luc Maisonobe wrote:
> Le 20/08/2012 05:51, Sébastien Brisard a écrit :
> > Hi,
> > the current implementation of Gamma.logGamma(double) fails silently when
> > the argument is not strictly positive, returning Double.NaN.
> > Previous discussions on this ML show that we all agree (do we?) that
> > throwing an exception is preferrable. Since I'm reimplementing this
> > function, I propose to change this behaviour. Do you think that would be
> > allowed in 3.1?
> 
> Yes, I think this kind of change can be introduced in a minro revision.
> 
> Luc
> 
> > 
> > I do not think it breaks binary compatibility. Neither does it break the
> > contract of this method, since (quite fortunately) its behavior was not
> > specified in the Javadoc!

Even if it would, in accordance to a very recent discussion, breaking
compatibility for correcting a bug would be a risk worth taking.


Best regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [math] Double.NaN or NotStrictlyPositiveException?

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 20/08/2012 05:51, Sébastien Brisard a écrit :
> Hi,
> the current implementation of Gamma.logGamma(double) fails silently when
> the argument is not strictly positive, returning Double.NaN.
> Previous discussions on this ML show that we all agree (do we?) that
> throwing an exception is preferrable. Since I'm reimplementing this
> function, I propose to change this behaviour. Do you think that would be
> allowed in 3.1?

Yes, I think this kind of change can be introduced in a minro revision.

Luc

> 
> I do not think it breaks binary compatibility. Neither does it break the
> contract of this method, since (quite fortunately) its behavior was not
> specified in the Javadoc!
> 
> Thanks for your suggestions,
> Sébastien
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org