commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <sebastien.bris...@m4x.org>
Subject [math] UnexpectedNegativeIntegerException
Date Thu, 23 Aug 2012 03:16:42 GMT
Hi,
in MATH-849, I have proposed an implementation of Gamma(x)
(previously, class Gamma had only logGamma(x)). Gamma(x) is not
defined for x negative integer. In such instances, I would like to
throw an exception instead of returning Double.NaN. However, creating
a new exception in o.a.c.m.exception seems exagerated, since it's very
unlikely that this exception should be used elsewhere (or maybe).
Should I define a nested exception instead [1]?

What do you think of the name "UnexpectedNegativeIntegerException"? It
does not really match the pattern of already defined exceptions, but I
can't find a better name.

Thanks,
S├ębastien

[1] I don't think nested exceptions is the way to go, as the
localizable message should have to be defined in
o.a.c.m.exception.util.LocalizedFormats.


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


Mime
View raw message