You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mpm...@googlegroups.com
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?
Fredrik Johansson
unread,
Nov 2, 2012, 3:09:14 AM11/2/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mpm...@googlegroups.com
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.