[Jython-checkins] jython (merge 2.5 -> default): Merge from 2.5.
frank.wierzbicki
jython-checkins at python.org
Fri Mar 30 22:17:20 CEST 2012
http://hg.python.org/jython/rev/2c973a8c50ed
changeset: 6511:2c973a8c50ed
parent: 6509:cdc523f2b883
parent: 6510:c514ff14cef5
user: Frank Wierzbicki <fwierzbicki at gmail.com>
date: Fri Mar 30 13:17:11 2012 -0700
summary:
Merge from 2.5.
files:
src/org/python/core/PyFloat.java | 36 ++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/src/org/python/core/PyFloat.java b/src/org/python/core/PyFloat.java
--- a/src/org/python/core/PyFloat.java
+++ b/src/org/python/core/PyFloat.java
@@ -279,6 +279,42 @@
}
@Override
+ public PyObject __gt__(PyObject other) {
+ // NaN > anything is always false.
+ if (Double.isNaN(getValue())) {
+ return Py.False;
+ }
+ return null;
+ }
+
+ @Override
+ public PyObject __ge__(PyObject other) {
+ //NaN >= anything is always false.
+ if (Double.isNaN(getValue())) {
+ return Py.False;
+ }
+ return null;
+ }
+
+ @Override
+ public PyObject __lt__(PyObject other) {
+ //NaN < anything is always false.
+ if (Double.isNaN(getValue())) {
+ return Py.False;
+ }
+ return null;
+ }
+
+ @Override
+ public PyObject __le__(PyObject other) {
+ //NaN >= anything is always false.
+ if (Double.isNaN(getValue())) {
+ return Py.False;
+ }
+ return null;
+ }
+
+ @Override
public int __cmp__(PyObject other) {
return float___cmp__(other);
}
--
Repository URL: http://hg.python.org/jython
More information about the Jython-checkins
mailing list