Commit a999e789 authored by Facundo Batista's avatar Facundo Batista

Major change in the internal structure of the Decimal

number: now it does not store the mantissa as a tuple
of numbers, but as a string.

This avoids a lot of conversions, and achieves a
speedup of 40%. The API remains intact.

Thanks Mark Dickinson.
parent 9ac8820d
This diff is collapsed.
...@@ -464,6 +464,7 @@ class DecimalExplicitConstructionTest(unittest.TestCase): ...@@ -464,6 +464,7 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) ) self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) )
self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) ) self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) )
self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) ) self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) )
self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )
def test_explicit_from_Decimal(self): def test_explicit_from_Decimal(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment