sympy/sympy-0.6.7-mpf.patch
2010-10-25 11:43:21 +03:00

109 lines
2.3 KiB
Diff

Index: sympy-0.6.7/sympy/core/numbers.py
===================================================================
--- sympy-0.6.7.orig/sympy/core/numbers.py
+++ sympy-0.6.7/sympy/core/numbers.py
@@ -1040,6 +1040,7 @@ class Zero(Integer):
p = 0
q = 1
+ _mpf_ = (0, 0L, 0, 0)
is_positive = False
is_negative = False
is_finite = False
@@ -1082,6 +1083,7 @@ class One(Integer):
p = 1
q = 1
+ _mpf_ = (0, 1L, 0, 1)
is_prime = True
@@ -1110,6 +1112,7 @@ class NegativeOne(Integer):
p = -1
q = 1
+ _mpf_ = (1, 1L, 0, 1)
__slots__ = []
@@ -1150,6 +1153,7 @@ class Half(Rational):
p = 1
q = 2
+ _mpf_ = (0, 1L, -1, 1)
__slots__ = []
@@ -1163,6 +1167,7 @@ class Infinity(Rational):
p = 1
q = 0
+ _mpf_ = mpmath.inf._mpf_
__slots__ = []
@@ -1236,6 +1241,7 @@ class NegativeInfinity(Rational):
p = -1
q = 0
+ _mpf_ = mpmath.ninf._mpf_
__slots__ = []
@@ -1303,6 +1309,7 @@ class NaN(Rational):
p = 0
q = 0
+ _mpf_ = mpmath.nan._mpf_
is_commutative = True
is_real = None
@@ -1440,6 +1447,7 @@ class NumberSymbol(Atom):
class Exp1(NumberSymbol):
+ _mpf_ = mpmath.e._mpf_
is_real = True
is_positive = True
is_negative = False # XXX Forces is_negative/is_nonnegative
@@ -1469,6 +1477,7 @@ class Exp1(NumberSymbol):
class Pi(NumberSymbol):
+ _mpf_ = mpmath.pi._mpf_
is_real = True
is_positive = True
is_negative = False
@@ -1495,6 +1504,7 @@ class Pi(NumberSymbol):
class GoldenRatio(NumberSymbol):
+ _mpf_ = mpmath.phi._mpf_
is_real = True
is_positive = True
is_negative = False
@@ -1520,6 +1530,7 @@ class GoldenRatio(NumberSymbol):
class EulerGamma(NumberSymbol):
+ _mpf_ = mpmath.euler._mpf_
is_real = True
is_positive = True
is_negative = False
@@ -1543,6 +1554,7 @@ class EulerGamma(NumberSymbol):
class Catalan(NumberSymbol):
+ _mpf_ = mpmath.catalan._mpf_
is_real = True
is_positive = True
is_negative = False
@@ -1566,6 +1578,7 @@ class Catalan(NumberSymbol):
class ImaginaryUnit(Atom):
__metaclass__ = SingletonMeta
+ _mpc_ = mpmath.j._mpc_
is_commutative = True
is_imaginary = True
is_bounded = True