Ask Your Question

w4Kn0ADbGU9iW6Pq's profile - activity

2021-12-06 15:32:44 +0100 received badge  Notable Question (source)
2021-12-06 15:32:44 +0100 received badge  Popular Question (source)
2016-02-25 22:54:33 +0100 received badge  Student (source)
2016-02-24 17:14:00 +0100 received badge  Scholar (source)
2016-02-23 16:02:05 +0100 asked a question Why do mpmath mpf values compare strangely to Integers?

With both sage 6.8 and 7.1.beta3 on OSX 10.10.5 I get this odd result:

sage: import mpmath
sage: max(Integer(0), mpmath.mpf(-1))
0
sage: max(mpmath.mpf(-1), Integer(0))
mpf('-1.0')
sage: Integer(0) < mpmath.mpf(-1)
True

The maximum of 0 and -1 should be 0, although I'm not sure if it should be Integer(0) or mpf(0).

Am I missing something about how sage expects me to handle arbitrary-precision floating-point numbers?