commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <phil.ste...@gmail.com>
Subject Re: [math] UnexpectedNegativeIntegerException
Date Thu, 23 Aug 2012 20:24:10 GMT
On 8/23/12 12:42 PM, Ted Dunning wrote:
> On Thu, Aug 23, 2012 at 3:00 PM, Phil Steitz <phil.steitz@gmail.com> 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)
NaN
>  or log(0)
-INF
>  or log(-2)
NaN

Basically, I am happy with how java.lang.Math handles - and
documents behavior - for these.

Phil
>  ?
>
> Exception or NaN?
>


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


Mime
View raw message