[Numpy-discussion] Are "min", "max" documented for scalars?

2012-06-06 Thread Edward C. Jones
Python "max" and "min" have an interesting and _useful_ behavior when
applied to numpy scalars and Python numbers.  Here is a piece of
pseudo-code:

def max(a, b):
 if int(b) > int(a):
 return b
 else:
 return a

The larger object is returned unchanged.  If the two objects are equal,
return the first unchanged.

Is the behavior of "max", "min", "<", "<=", etc. for numpy scalar objects
documented somewhere?

keywords: greater than less than

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Are "min", "max" documented for scalars?

2012-06-07 Thread Edward C. Jones
Silly mistakes.

If a and b are Python ints, Python floats, or non-complex 
numpy.number's,  "max" returns, unchanged, the largrt of the two 
objects.  There is no coercion to a common type.  This useful behavior 
needs to be documented.

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Are "min", "max" documented for scalars?

2012-06-07 Thread Robert Kern
On Thu, Jun 7, 2012 at 2:25 PM, Edward C. Jones  wrote:
> Silly mistakes.
>
> If a and b are Python ints, Python floats, or non-complex
> numpy.number's,  "max" returns, unchanged, the largrt of the two
> objects.  There is no coercion to a common type.  This useful behavior
> needs to be documented.

Suggestions for improving the standard Python documentation (which
documents these functions) can be sent here:

  http://docs.python.org/bugs.html#documentation-bugs

-- 
Robert Kern
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion