Just a quick question
math.modf(x) is a python function that returns the fractional and integer parts of x. Both results carry the sign of x and are floats.
Therefore, if I write, for instance, 5.4 to the python 2.6.6 command line I think I should get (0.4, 5.0) but I get instead (0.40000000000000036, 5.0).
Is this a bug?

Nope. Floating point arithmetic error.
0.4 cannot be stored as a finite binary number.

Oh, that's true. thanks!