Python Forum
method float.as_integer_ratio() always ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
method float.as_integer_ratio() always ...
#15
Skaperen Wrote:can you view source on the forum page with the link?
Yes in the source it says
Output:
right now. the 1864 ratios in that list were calculated in around 87 milliseconds of CPU on an i7 at 2.5 GHz under Pike 8.0. the Python version is slower because Python ints are slower than Pike ints. i'll look for that code so i can time it and put it online.<br /> <br /> <a rel="nofollow" href="http://ipal.net/pi.ratios" target="_blank">http://ipal.net/pi.ratios</a><br /> <a rel="nofollow" href="http://ipal.net/intfrac.pike" target="_blank">http://ipal.net/intfrac.pike</a><br /> <hr class="mycode_hr" /> calculating both ratios in the 54 bit mantissa of type double on x86, results in exactly the same value. doing it in the 65 bit mantissa of type long double on x86 may well have different results. have not tested that but a somewhat larger ratio can produce the maximum precision possible in long double.
Reply


Messages In This Thread
RE: method float.as_integer_ratio() always ... - by Gribouillis - Jul-04-2019, 05:58 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020