Message220260
Agreed with Tim.
Oddly enough[1], remembering that with binary floating-point numbers, what you see is not what you get[2], it turns out that 8.881784197001252e-16 (= Fraction(1, 1125899906842624)) is in fact *exactly* the right answer, in that it's a generator for the additive subgroup of the rationals generated by 2.7 (= Fraction(3039929748475085, 1125899906842624)) and 107.3 (=Fraction(7550566250263347, 70368744177664)).
[1] Actually not so odd, given that % is a perfectly exact operation when applied to two positive finite floats.
[2] https://docs.python.org/2/tutorial/floatingpoint.html |
|
Date |
User |
Action |
Args |
2014-06-11 12:25:42 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, pacosta |
2014-06-11 12:25:42 | mark.dickinson | set | messageid: <1402489542.74.0.899098718353.issue21712@psf.upfronthosting.co.za> |
2014-06-11 12:25:42 | mark.dickinson | link | issue21712 messages |
2014-06-11 12:25:42 | mark.dickinson | create | |
|