Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2445

General discussion • Re: Revisiting Pi on the Raspberry Pi: A Decade of Progress in Precision Computing

$
0
0
pari-gp Calculator / Alpine Linux / rPi-2 : π to a million digits

Code:

#\p 1000000        \\ Set precision to 1 million digitsmyPi = Pi;        \\ Compute πwrite("pi_output.txt", myPi);  \\ Save π to a text file##
GP/PARI CALCULATOR Version 2.17.2 , compiled: Mar 6 2025

Code:

~ $ fastfetch       .hddddddddddddddddddddddh.           ubu@localhost      :dddddddddddddddddddddddddd:          -------------     /dddddddddddddddddddddddddddd/         OS: Alpine Linux edge armv7l    +dddddddddddddddddddddddddddddd+        Host: Raspberry Pi 2 Model B Rev 1.1  `sdddddddddddddddddddddddddddddddds`      Kernel: Linux 6.12.17-0-rpi `ydddddddddddd++hdddddddddddddddddddy`     Uptime: 3 mins.hddddddddddd+`  `+ddddh:-sdddddddddddh.    Packages: 927 (apk)hdddddddddd+`      `+y:    .sddddddddddh    Shell: shddddddddh+`   `//`   `.`     -sddddddddd    Terminal: /dev/pts/0ddddddh+`   `/hddh/`   `:s-    -sddddddd    CPU: BCM2836 (4) @ 0.90 GHzddddh+`   `/+/dddddh/`   `+s-    -sddddd    GPU: Broadcom bcm2835-vc4 [Integrated]ddd+`   `/o` :dddddddh/`   `oy-    .yddd    Memory: 98.72 MiB / 921.12 MiB (11%)hdddyo+ohddyosdddddddddho+oydddy++ohdddh    Swap: Disabled.hddddddddddddddddddddddddddddddddddddh.    Disk (/): 5.29 GiB / 14.21 GiB (37%) - ext4 `yddddddddddddddddddddddddddddddddddy`     Local IP (eth0): 192.168.1.104/24  `sdddddddddddddddddddddddddddddddds`      Locale: C.UTF-8    +dddddddddddddddddddddddddddddd+     /dddddddddddddddddddddddddddd/      :dddddddddddddddddddddddddd:       .hddddddddddddddddddddddh.~ $ gp <pi1m.gpReading GPRC: /home/ubu/.gprcGPRC Done.                  GP/PARI CALCULATOR Version 2.17.2 (released)           armv8l running linux (arm/GMP-6.3.0 kernel) 32-bit version           compiled: Mar  6 2025, gcc version 14.2.0 (Alpine 14.2.0)                    threading engine: pthread, nbthreads = 4                (readline v8.2 disabled, extended help enabled)                     Copyright (C) 2000-2024 The PARI GroupPARI/GP is free software, covered by the GNU General Public License, and comesWITHOUT ANY WARRANTY WHATSOEVER.Type ? for help, \q to quit.Type ?18 for how to get moral (and possibly technical) support.parisize = 300000000, primelimit = 1048576, factorlimit = 1048576   timer = 1 (on)   realprecision = 1000007 significant digits (1000000 digits displayed)cpu time = 8,508 ms, real time = 8,843 ms.cpu time = 2,136 ms, real time = 2,227 ms.  ***   last result: cpu time 2,136 ms, real time 2,227 ms.Goodbye!~ $
From the Raspberry Pi 2 running Alpine Linux with PARI/GP 2.17.2, the computation and file output times can be inferred from the provided execution logs:

Compute Time (Calculating π to 1 million digits):

CPU time: 8,508 ms (8.508 seconds)
Real time: 8,843 ms (8.843 seconds)
File Output Time (Writing π to pi_output.txt):

CPU time: 2,136 ms (2.136 seconds)
Real time: 2,227 ms (2.227 seconds)
Total time (Compute + File Output):
CPU time: 10.644 seconds
Real time: 11.070 seconds
This shows that the Raspberry Pi 2 running Alpine Linux computed π to 1 million digits in ~8.8 seconds and wrote the result to a file in ~2.2 seconds, for a total execution time of about 11 seconds

Statistics: Posted by geev03 — Tue Mar 11, 2025 9:04 pm



Viewing all articles
Browse latest Browse all 2445

Trending Articles