[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: math.max/math.min given NaN
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 24 Feb 2008 19:17:10 -0300
> $ lua
> Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> > =math.max(0/0),math.min(0/0)
> nan nan
> > =math.max(0/0,1),math.min(0/0,1)
> nan nan
> > =math.max(1,0/0),math.min(1,0/0)
> 1 1
>
> Is that behavior defined? Should it be defined?
I don't see how to define it unless there is a specific rule for nan.
Both "x such that x >= y[i]" or "x such that (not y[i] > x)" seem
undefined when nan is present. (In the first case no 'x' satisfies
the rule; in the second case more than one 'x' may satisfy it.)
-- Roberto