diff options
author | Reinier Heeres <reinier@heeres.eu> | 2007-11-25 12:21:13 (GMT) |
---|---|---|
committer | Reinier Heeres <reinier@heeres.eu> | 2007-11-25 12:21:13 (GMT) |
commit | 250ea89c8ffb0778abc64ba722d180929c8482a5 (patch) | |
tree | 8c7099032e1eed626b8149e2952cb49e31b834f6 /mathlib.py | |
parent | 3ebb3add453b593e4d97b081976a0ccd8845ac63 (diff) |
Fix log() of Rational number bug
Diffstat (limited to 'mathlib.py')
-rw-r--r-- | mathlib.py | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -187,7 +187,7 @@ class MathLib: return ret def is_int(self, n): - if type(n) is types.IntType: + if type(n) is types.IntType or type(n) is types.LongType: return True if not isinstance(n, Decimal): @@ -248,13 +248,13 @@ class MathLib: return self.d(math.exp(float(x))) def ln(self, x): - if x > 0: + if float(x) > 0: return self.d(math.log(float(x))) else: return 0 def log10(self, x): - if x > 0: + if float(x) > 0: return self.d(math.log10(float(x))) else: return 0 @@ -278,7 +278,6 @@ class MathLib: return self.d(math.sin(float(x * self.angle_scaling))) def cos(self, x): - _logger.debug('cos of %r, (%r)', x, self.angle_scaling) return self.d(math.cos(float(x * self.angle_scaling))) def tan(self, x): |