Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mathlib.py
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-11-25 12:21:13 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-11-25 12:21:13 (GMT)
commit250ea89c8ffb0778abc64ba722d180929c8482a5 (patch)
tree8c7099032e1eed626b8149e2952cb49e31b834f6 /mathlib.py
parent3ebb3add453b593e4d97b081976a0ccd8845ac63 (diff)
Fix log() of Rational number bug
Diffstat (limited to 'mathlib.py')
-rw-r--r--mathlib.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/mathlib.py b/mathlib.py
index ff17de5..71deb65 100644
--- a/mathlib.py
+++ b/mathlib.py
@@ -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):