no more float ready for decimal!

This commit is contained in:
Benjamin Bertrand
2016-02-15 15:20:24 +03:00
parent ab8b80758c
commit 821810ca47
4 changed files with 25 additions and 43 deletions

View File

@@ -2,6 +2,7 @@
# encoding: utf-8
from .render import Renderable
from decimal import Decimal
class Explicable(Renderable):
@@ -79,18 +80,18 @@ 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 """
class Explicable_Decimal(Decimal, Explicable):
""" An Explicable_Decimal is an decimal which can be explain """
isNumber = True
def __init__(self, val):
super(Explicable_float, self).__init__(val)
super(Explicable_Decimal, self).__init__(val)
self._val = val
self.postfix_tokens = [self]
self.steps = []
def simplify(self):
return Explicable_float(self._val)
return Explicable_Decimal(self._val)
def __txt__(self):
return str(self._val)