commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <>
Subject Re: [math] UnexpectedNegativeIntegerException
Date Thu, 23 Aug 2012 19:42:06 GMT
On Thu, Aug 23, 2012 at 3:00 PM, Phil Steitz <> wrote:

> The problem is that contracts can often be written so that instances
> of 1) are turned into instances of 0).  Gamma(-) is a great
> example.  The singularities at negative integers could be viewed as
> making negative integer arguments "illegal" or "nonsense" from the
> API standpoint, or legitimate arguments for which no well-defined,
> representable value can be returned.  Personally, I would prefer to
> get NaN back from this function and just point out the existence of
> the singularities in the javadoc.

So what do you think should happen from sqrt(-1) or log(0) or log(-2) ?

Exception or NaN?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message