If you want IEEE 754⁄854 decimal behaviour, what you want to use is the decimal module
Be an Automator, spend your days debugging everyone else’s software, drive the art forward, and enjoy (in the long run) incredible job security!
His code used eight comparisons to check whether the endpoint of one of the ranges was contained within the other range. In Python it would look like this:
def overlap(start1, end1, start2, end2): """Does the range (start1, end1) overlap with (start2, end2)?""" return ( start1 <= start2 <= end1 or start1 <= end2 <= end1 or start2 <= start1 <= end2 or start2 <= end1 <= end2 )
I said you could do it in two comparisons rather than eight, but could never remember the trick.
Cubr is a project I completed in three weeks at the end of my introductory computer science class at CMU. The idea is simple: you mix up a Rubik’s cube. You show the cube to your computer’s webcam. Some magic happens, and your cube appears onscreen. Then, the cube begins to solve itself, and all you have to do is follow along and you will have solved your cube!
The Python packages in the official Ubuntu archives generally don’t go back all that far, but people might still need to develop and test against these old Python interpreters. Felix Krull maintains a PPA (package archive) of older Python versions that are easy to install on Ubuntu.