summaryrefslogtreecommitdiff
path: root/src/examples/fourFn.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/fourFn.py')
-rw-r--r--src/examples/fourFn.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/examples/fourFn.py b/src/examples/fourFn.py
index fedd2aa..8ea4609 100644
--- a/src/examples/fourFn.py
+++ b/src/examples/fourFn.py
@@ -87,7 +87,7 @@ fn = { "sin" : math.sin,
"abs" : abs,
"trunc" : lambda a: int(a),
"round" : round,
- "sgn" : lambda a: abs(a)>epsilon and cmp(a,0) or 0}
+ "sgn" : lambda a: (a > epsilon) - (a < -epsilon) }
def evaluateStack( s ):
op = s.pop()
if op == 'unary -':