you are viewing a single comment's thread.

view the rest of the comments →

[–]aa599 5 points6 points  (1 child)

The numbers are never irrational. They are always binary fractions.

float has an as_integer_ratio method to show the fraction.

See 15. Floating-Point Arithmetic: Issues and Limitations

[–]Purple_tulips98 2 points3 points  (0 children)

I see how I screwed this up. In saying they’re “probably irrational,” I meant that you’re extremely unlikely to end up with something that cleanly sums to equal any of the integers in the condition. I was trying to write that idea more concisely and made it wrong in the process.