On Fri, Nov 2, 2012 at 4:39 AM, Allen Rabinovich <allen
...@gmail.com> wrote:
> A beginner mpmath question here: how do I compute a min (or a max) of two
> mpf numbers? Is just the regular python min(a,b) the answer? Why does that
> work properly, given that mpf's are their own datatypes, and min relies on
> standard comparison operators?
Yes, min(a,b) works fine. It works because mpmath classes provide
comparison methods (__ge__, __gt__, etc.) so that the standard
comparison operators (>=, >, etc.) can be used. This is standard for
custom numeric types in Python.
Fredrik