Parse float and create Explicable_float

This commit is contained in:
Benjamin Bertrand
2016-02-13 19:47:35 +03:00
parent 97d18be64b
commit b5d383a4be
3 changed files with 37 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ class Explicable(Renderable):
return False
class Explicable_int(int, Explicable):
""" An Explicable_int is an int which can be explain """
isNumber = True
def __init__(self, val):
@@ -78,6 +79,25 @@ class Explicable_int(int, Explicable):
def __tex__(self):
return str(self._val)
class Explicable_float(float, Explicable):
""" An Explicable_float is an float which can be explain """
isNumber = True
def __init__(self, val):
super(Explicable_float, self).__init__(val)
self._val = val
self.postfix_tokens = [self]
self.steps = []
def simplify(self):
return Explicable_float(self._val)
def __txt__(self):
return str(self._val)
def __tex__(self):
return str(self._val)
# -----------------------------