Tag Archives: Float

Computing Large Determinants in Python

Story: For my seminar work, I had to calculate the determinant of a large integer matrix. In this case, large meant n>=500. You might say that this isn’t very large and I would agree. However, it is large enough to … Continue reading

Posted in Algorithms, computer science, Math, Programming, Python, Research | Tagged , , , , , | 2 Comments

You know you need to install a new Python version when…

>>> import decimal >>> decimal.Decimal(’0.2’) <&nbsp; 0.3 False >>>>>> import decimal >>> decimal.Decimal(‘0.2’) <&nbsp; 0.3 False >>> This little gem took me two hours to track down. It turns out that since my code is using sqlobject, it also uses … Continue reading

Posted in Programming, Python | Tagged , , , | 4 Comments

The Case Against Floating Point ==

While working on the clipping bug, I had to do some floating point comparisons. To handle this virtual mine-field, I used simple precision comparisons. Not surprisingly, I wanted to know what’s ‘the right way’ to do this in Python. When … Continue reading

Posted in Programming, Python | Tagged , , , , | 3 Comments