Post #1540131
2026-04-20 11:01 UTC
RE: https://oldbytes.space/@electron_greg/116409619073557779
A nice Pi benchmark in a more or less universal Basic. As noted downthread, this isn't an invitation to compare methods, but a fixed method to compare platforms.
But of course the temptation is very strong! The BBC Micro runs this version in 19 seconds - with some considerable noodling I got it down to 8.11 seconds, but it's now very BBC Basic specific.
And of course, we can do better by tweaking the algorithm - base 10000 is a lot faster than base 10, and just as useful.
A program very like the one exhibited here, and credited to Valentin Albillo, appears in the Stardot thread "Calculating digits of Pi in Basic"
https://stardot.org.uk/forums/viewtopic.php?t=18066
The best BBC Basic effort I could come up with is towards the end of that thread, producing the requested 20 digits in 2.07 seconds.
Replies (1)
-
@electron_greg@oldbytes.space 2026-04-20 11:03
@EdS Thank you for crediting Valentin Albillo.