On Thu, Aug 23, 2012 at 3:00 PM, Phil Steitz <phil.ste...@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) or log(0) or log(-2) ? Exception or NaN?