Browse Source

Don't blindly take a string as a number

Johann Schmitz 2 years ago
parent
commit
f5acefb21e
Signed by: Johann Schmitz <johann@j-schmitz.net> GPG Key ID: A084064277C501ED
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/rpn/__init__.py

+ 1
- 1
src/rpn/__init__.py View File

@@ -104,7 +104,7 @@ class RPN(object):
104 104
 			elif x in OPERATORS or isinstance(x, (int, float)):
105 105
 				tokens.append(x)
106 106
 			else:
107
-				tokens.append(float(x) if '.' in x or 'e' in x.lower() else int(x))
107
+				tokens.append(float(x) if '.' in x else int(x))
108 108
 
109 109
 		while len(tokens) > 1:
110 110
 			for i, token in enumerate(tokens):