I won’t be telling you what is Pi, it’s history…..blah blah…you can find this on Wikipedia. This place is for something interesting. Something that will make you think. Here’s an interesting unix command using binary calculator (bc). It will calculate the value of Pi with an arbitrary number of decimals (limited only by the limit of you RAM, OS). Sounds interesting haa….
echo 'scale=1000;4*a(1)' | bc -l
Have a look
Now…how can we have fun with this…….think..think idea You can use this as a benchmark. Challenge you PC. I mean… increase the number of decimals that are echoed. In the above screenshot, 1000 decimals were echoed. It was instantaneous (depends upon your configuration)
Results of the tests that I conducted :
- 1000 decimals – almost instantaneous
- 2000 decimals – 2 sec 40 millisecond
- 3000 decimals – 6 sec 50 millisecond
- 5000 decimals – 21 sec 83 millisecond surprised shocking …it took i3 more than 21 seconds
Let’s make it more interesting and try this on the Raspberry Pi with default configuration (without Overclocking).
time echo 'scale=1000;4*a(1)' | bc -l
For Raspberry Pi :
- 1000 decimal : 4 sec 37 millisecond
- 2000 decimal : 24 sec 29 millisecond
Similarly you can conduct tests on your Raspberry Pi. The results that you get may differ from the one shown here, it depends on your Pi. The next step would be to overclock your Pi & compare the results. This will help you benchmark your Pi. We will be covering this in some other tutorial. For now that’s it from my side. Hope you enjoyed the “Pi” story.
If you have anything to add to this do let me know. Share your results so that others can compare & benchmark their Raspberry Pi.
Thank you for being patient. Have a good day.