{"id":64541,"date":"2024-09-01T03:01:00","date_gmt":"2024-08-31T17:01:00","guid":{"rendered":"https:\/\/65.254.95.247\/ITblog\/?p=64541"},"modified":"2024-08-31T16:39:23","modified_gmt":"2024-08-31T06:39:23","slug":"php-gnu-multiple-precision-mathematics-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-gnu-multiple-precision-mathematics-tutorial\/","title":{"rendered":"PHP GNU Multiple Precision Mathematics Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/factorial.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP GNU Multiple Precision Mathematics Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/gmp_maths.gif\" title=\"PHP GNU Multiple Precision Mathematics Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP GNU Multiple Precision Mathematics Tutorial<\/p><\/div>\n<p>Maths fun &#8220;PHP style&#8221; can be had with the <a target=\"_blank\" title='GNU Multiple Precision' href='https:\/\/www.php.net\/manual\/en\/book.gmp.php' rel=\"noopener\">GNU Multiple Precision (GMP)<\/a> extension with echoes of PHP mathematics work talked about with <a title='PHP Bcmath Factorial Tutorial' href='#phpbft'>PHP Bcmath Factorial Tutorial<\/a>.<\/p>\n<p>Again, on this AlmaLinux PHP (starting with 8) environment, we started off with those ever fascinating &#8230;<\/p>\n<ul>\n<li>factorial calculations &#8230; and then followed that up with &#8230;<\/li>\n<li>number to the power of &#8230;<\/li>\n<li>next greatest prime number &#8230;<\/li>\n<li>least common multiple &#8230;<\/li>\n<li>greatest common divisor<\/li>\n<\/ul>\n<p> &#8230; functionalities the user can try for themselves &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n\/\/ factorial.php<br \/>\n\/\/ RJM Programming - August, 2024<br \/>\n\/\/ Thanks to https:\/\/www.php.net\/manual\/en\/gmp.examples.php<br \/>\n<br \/>\n$whereplace=shell_exec(\"ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'\");<br \/>\nif (strpos(($whereplace . ' ' . $_SERVER['SERVER_ADDR']), '65.254.92.213') !== false) {<br \/>\n     header('Location: https:\/\/65.254.95.247\/PHP\/factorial.php');<br \/>\n     exit;<br \/>\n}<br \/>\n<br \/>\n$fstyle=\"\";<br \/>\n$pstyle=\"\";<br \/>\n$facttodo=1000;<br \/>\n$pow=\"1\";<br \/>\nif (isset($_GET['facttodo'])) {<br \/>\n if (strlen('' . $_GET['facttodo']) &gt; 0) {<br \/>\n  $facttodo=str_replace('+',' ',urldecode($_GET['facttodo']));<br \/>\n }<br \/>\n} else if (isset($_POST['facttodo'])) {<br \/>\n if (strlen('' . $_POST['facttodo']) &gt; 0) {<br \/>\n  $facttodo=str_replace('+',' ',urldecode($_POST['facttodo']));<br \/>\n }<br \/>\n}<br \/>\nif (isset($_GET['pow'])) {<br \/>\n if (strlen('' . $_GET['pow']) &gt; 0) {<br \/>\n  $pow=str_replace('+',' ',urldecode($_GET['pow']));<br \/>\n }<br \/>\n} else if (isset($_POST['pow'])) {<br \/>\n if (strlen('' . $_POST['pow']) &gt; 0) {<br \/>\n  $pow=str_replace('+',' ',urldecode($_POST['pow']));<br \/>\n }<br \/>\n}<br \/>\n<br \/>\nfunction fact($x) {<br \/>\n    $return = 1;<br \/>\n    for ($i=2; $i &lt;= $x; $i++) {<br \/>\n        $return = gmp_mul($return, $i);<br \/>\n    }<br \/>\n    return $return;<br \/>\n}<br \/>\n<br \/>\nfunction thepow($x, $y) {<br \/>\n    return gmp_pow($x, $y);<br \/>\n}<br \/>\n<br \/>\nfunction thegcd($x, $y) {<br \/>\n    return gmp_gcd($x, $y);<br \/>\n}<br \/>\n<br \/>\nfunction thelcm($x, $y) {<br \/>\n    return gmp_lcm($x, $y);<br \/>\n}<br \/>\n<br \/>\nfunction nextprime($x) {<br \/>\n    return gmp_nextprime($x);<br \/>\n}<br \/>\n<br \/>\necho \"&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;style&gt;<br \/>\n  form {<br \/>\n    display: inline-block;<br \/>\n  }<br \/>\n  <br \/>\n  textarea {<br \/>\n    background-color: yellow;<br \/>\n  }<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;h1&gt;Factorials via GMP&lt;\/h1&gt;<br \/>\n&lt;h3&gt;RJM Programming - August, 2024&lt;\/h3&gt;<br \/>\n&lt;h4&gt;Factorial of &lt;form method=POST action=.\/factorial.php&gt;&lt;input style=display:inline-block; onblur=\\\"document.getElementById('mysub').click();\\\" type=number step=1 name=facttodo id=facttodo value='\" . $facttodo . \"'&gt;&lt;\/input&gt;&lt;input type=submit style=display:none; id=mysub&gt;&lt;\/input&gt;&lt;\/form&gt; is ...&lt;\/h4&gt;<br \/>\n&lt;textarea style=width:95%;height:34%;&gt;\" . gmp_strval(fact($facttodo)) . \"&lt;\/textarea&gt;<br \/>\n&lt;h4&gt;&lt;span&gt;Number &lt;\/span&gt;&lt;form method=POST action=.\/factorial.php&gt;&lt;input style=display:inline-block; data-onblur=\\\"document.getElementById('mysub').click();\\\" type=number step=1 name=facttodo id=facttodotwo value='\" . $facttodo . \"'&gt;&lt;\/input&gt;&lt;span&gt; to the power of &lt;\/span&gt;&lt;input style=display:inline-block; onblur=\\\"document.getElementById('mysubpow').click();\\\" type=number step=1 name=pow id=pow value='\" . $pow . \"'&gt;&lt;\/input&gt;&lt;input type=submit style=display:none; id=mysubpow&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;span&gt; is ...&lt;\/span&gt;&lt;\/h4&gt;<br \/>\n&lt;textarea style=width:95%;height:5%;&gt;\" . gmp_strval(thepow($facttodo, $pow)) . \"&lt;\/textarea&gt;<br \/>\n&lt;h4&gt;&lt;span&gt;Next prime greater than &lt;\/span&gt;&lt;form method=POST action=.\/factorial.php&gt;&lt;input style=display:inline-block; onblur=\\\"document.getElementById('mysubthree').click();\\\" type=number step=1 name=facttodo id=facttodothree value='\" . $facttodo . \"'&gt;&lt;\/input&gt;&lt;input type=submit style=display:none; id=mysubthree&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;span&gt; is ...&lt;\/span&gt;&lt;\/h4&gt;<br \/>\n&lt;textarea style=width:95%;height:3%;&gt;\" . gmp_strval(nextprime($facttodo)) . \"&lt;\/textarea&gt;<br \/>\n&lt;table cellpadding=15&gt;<br \/>\n&lt;tr&gt;&lt;td&gt;<br \/>\n&lt;h4&gt;&lt;span&gt;Least common multiple of &lt;\/span&gt;&lt;form method=POST action=.\/factorial.php&gt;&lt;input style=display:inline-block; data-onblur=\\\"document.getElementById('mysub').click();\\\" type=number step=1 name=facttodo id=facttodofive value='\" . $facttodo . \"'&gt;&lt;\/input&gt;&lt;span&gt; and &lt;\/span&gt;&lt;input style=display:inline-block; onblur=\\\"document.getElementById('mysubfive').click();\\\" type=number step=1 name=pow id=powfive value='\" . $pow . \"'&gt;&lt;\/input&gt;&lt;input type=submit style=display:none; id=mysubfive&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;span&gt; is ...&lt;\/span&gt;&lt;\/h4&gt;<br \/>\n&lt;textarea style=width:95%;height:3%;&gt;\" . gmp_strval(thegcd($facttodo, $pow)) . \"&lt;\/textarea&gt;<br \/>\n&lt;\/td&gt;&lt;td&gt;<br \/>\n&lt;h4&gt;&lt;span&gt;Greatest common divisor of &lt;\/span&gt;&lt;form method=POST action=.\/factorial.php&gt;&lt;input style=display:inline-block; data-onblur=\\\"document.getElementById('mysub').click();\\\" type=number step=1 name=facttodo id=facttodofour value='\" . $facttodo . \"'&gt;&lt;\/input&gt;&lt;span&gt; and &lt;\/span&gt;&lt;input style=display:inline-block; onblur=\\\"document.getElementById('mysubfour').click();\\\" type=number step=1 name=pow id=powfour value='\" . $pow . \"'&gt;&lt;\/input&gt;&lt;input type=submit style=display:none; id=mysubfour&gt;&lt;\/input&gt;&lt;\/form&gt;&lt;span&gt; is ...&lt;\/span&gt;&lt;\/h4&gt;<br \/>\n&lt;textarea style=width:95%;height:3%;&gt;\" . gmp_strval(thelcm($facttodo, $pow)) . \"&lt;\/textarea&gt;<br \/>\n&lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;<br \/>\n&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>To install on AlmaLinux we ended up with a &#8220;dnf&#8221; package manager scenario looking like &#8230;<\/p>\n<p><code><br \/>\n[root@65-254-95-247 ~]# dnf list *gmp*<br \/>\nLast metadata expiration check: 3:23:48 ago on Sat 31 Aug 2024 10:51:31 AM AWST.<br \/>\nInstalled Packages<br \/>\ncpanel-perl-536-math-bigint-gmp.x86_64                         1.6011-1.cp108~el9                            @System<br \/>\nea-php80-php-gmp.x86_64                                        8.0.30-4.4.8.cpanel                           @EA4-c9<br \/>\nea-php81-php-gmp.x86_64                                        8.1.29-1.2.1.cpanel                           @EA4-c9<br \/>\nea-php82-php-gmp.x86_64                                        8.2.22-1.2.1.cpanel                           @EA4-c9<br \/>\ngmp.x86_64                                                     1:6.2.0-13.el9                                @baseos<br \/>\nAvailable Packages<br \/>\nalt-php-internal-gmp.x86_64                                    8.2.14-2.el9                                  imunify360<br \/>\nalt-php82-gmp.x86_64                                           8.2.8-1.el9                                   imunify360<br \/>\nea-php80-php-gmp-debuginfo.x86_64                              8.0.28-1.1.29.cpanel                          EA4-c9<br \/>\nea-php81-php-gmp-debuginfo.x86_64                              8.1.19-2.2.1.cpanel                           EA4-c9<br \/>\nea-php82-php-gmp-debuginfo.x86_64                              8.2.6-2.2.1.cpanel                            EA4-c9<br \/>\nea-php83-php-gmp.x86_64                                        8.3.10-1.2.1.cpanel                           EA4-c9<br \/>\ngmp.i686                                                       1:6.2.0-13.el9                                baseos<br \/>\ngmp-c++.i686                                                   1:6.2.0-13.el9                                appstream<br \/>\ngmp-c++.x86_64                                                 1:6.2.0-13.el9                                appstream<br \/>\ngmp-devel.i686                                                 1:6.2.0-13.el9                                appstream<br \/>\ngmp-devel.x86_64                                               1:6.2.0-13.el9                                appstream<br \/>\nperl-Crypt-DH-GMP.x86_64                                       0.00012-24.el9                                epel<br \/>\nperl-Math-BigInt-GMP.x86_64                                    1.6007-1.el9                                  epel<br \/>\nperl-Math-GMP.x86_64                                           2.24-1.el9                                    epel<br \/>\npython-gmpy2-doc.noarch                                        2.1.2-4.el9                                   epel<br \/>\npython3-gmpy2.x86_64                                           2.1.2-4.el9                                   epel<br \/>\n[root@65-254-95-247 ~]#<br \/>\n<\/code><\/p>\n<p> &#8230; for a functional <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/factorial.php_GETME\" rel=\"noopener\">first draft &#8220;proof of concept&#8221;<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/factorial.php\" rel=\"noopener\">GMP based mathematics web application<\/a> the user can try for themselves below &#8230;<\/p>\n<p><iframe style=\"width:95%;height:1200px;\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/factorial.php\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/php-gnu-multiple-precision-mathematics-tutorial\/' rel=\"noopener\">PHP GNU Multiple Precision Mathematics Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpbft'>Previous relevant <a target=\"_blank\" title='PHP Bcmath Factorial Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-bcmath-factorial-tutorial\/' rel=\"noopener\">PHP Bcmath Factorial Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/use_bcmath.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Bcmath Factorial Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/use_bcmath.gif\" title=\"PHP Bcmath Factorial Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Bcmath Factorial Tutorial<\/p><\/div>\n<p>Today we&#8217;ve had great guidance from <a target=\"_blank\" title='Useful link, thanks' href='https:\/\/www.php.net\/manual\/en\/book.bc.php' rel=\"noopener\">this webpage&#8217;s contributors<\/a>, thanks, writing a Factorial Calculator, using PHP and its <a target=\"_blank\" title='PHP Bcmath extension information' href='https:\/\/www.php.net\/manual\/en\/book.bc.php#:~:text=BCMath%20Arbitrary%20Precision%20Mathematics%20%C2%B6&#038;text=This%20extension%20is%20an%20interface,Philip%20Nelson%3B%20hence%20the%20name.' rel=\"noopener\">Bcmath<\/a> extension, revisiting concepts we last talked about when we presented <a title='PHP Bcmath Primer Tutorial' href='#phpbpt'>PHP Bcmath Primer Tutorial<\/a>.<\/p>\n<p>Are you like me with maps and sometimes with long numbers &#8230; just staring at a long integer trying to find patterns?<\/p>\n<p>Well, you need to let &#8230;<\/p>\n<blockquote style=font-size:44px;><p>\n<a target=\"_blank\" style='cursor:pointer;text-decoration:none;' href='https:\/\/en.wikipedia.org\/wiki\/Factorial' rel=\"noopener\">Factorials<\/a>\n<\/p><\/blockquote>\n<p> &#8230; into your life &#8230; the bigger the better!   Wonder at all those zeroes at the end?  Carve a long factorial into a piece of soap?  <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=-kbTbg00AJU' rel=\"noopener\">They<\/a> say the Lord&#8217;s Prayer was written on a pinhead &#8230; what are you waiting for?!<\/p>\n<p>Or just avail yourself of today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/use_bcmath.php_GETME\" rel=\"noopener\">use_bcmath.php<\/a> first draft PHP <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/use_bcmath.php\" rel=\"noopener\">Factorial Calculator<\/a> &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/use_bcmath.php\" style=\"width:90%;height:700px;\"><\/iframe><\/p>\n<p> &#8230; therapy.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/php-bcmath-factorial-tutorial\/' rel=\"noopener\">PHP Bcmath Factorial Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpbpt'>Previous relevant <a target=\"_blank\" title='PHP Bcmath Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-bcmath-primer-tutorial\/' rel=\"noopener\">PHP Bcmath Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/got_big_numbers.php\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Bcmath Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/bcmath.jpg\" title=\"PHP Bcmath Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP Bcmath Primer Tutorial<\/p><\/div>\n<p>Today we have an unusual linkage of tutorials, where we link our tutorial here, today, called &#8220;PHP Bcmath Primer Tutorial&#8221; with one from some time back (and I.T. historically speaking, a really long way back) called <a target=\"_blank\" title='Lisp Primer Tutorial' href='#lpt' rel=\"noopener\">Lisp Primer Tutorial<a> as shown below.<\/p>\n<p>The link is the way the languages handle some arithmetic on very large numbers, and today we present a web application that is like a calculator for some of those very large number calculations.  Am not certain Lisp does the work this way, but the <a target=\"_blank\" href='http:\/\/php.net\/manual\/en\/ref.bc.php' title='PHP bcmath information' rel=\"noopener\">&#8220;bcmath&#8221;<\/a> module in PHP, that we use for the purpose here today, uses &#8220;strings&#8221; to achieve the affect, so that I don&#8217;t believe there are any times during the calculations, necessarily, with the CPU <a target=\"_blank\" title='Register information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Processor_register' rel=\"noopener\">register<\/a>, that there are any great huge numbers being handled, but piece by piece, the CPU register is helping piece together that string that represents the answer we are after, not using any scientific notation in the process.<\/p>\n<p>We throw into the mix a bit of fun and games &#8230; just imagine you are on Central (train) Station in Sydney, or loads of other train stations in the world where it is pretty obvious the station announcements are pieced together bits of audio, and today we make use of the wonderful <a target=\"_blank\" title='Google Translate' href='http:\/\/translate.google.com' rel=\"noopener\">Google Translate<\/a> functionality in order for you to, optionally (and not always &#8230; no go with Firefox for instance), hear the results in those great mellifluous tones (in English, as default).<\/p>\n<p>Hope you really give some curly questions out there to the <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/got_big_numbers.php\" title='Click picture' rel=\"noopener\">live run<\/a>.  Here is the PHP source code using the &#8220;bcmath&#8221; module you could call <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/got_big_numbers.php_GETME\" title=\"got_big_numbers.php\" rel=\"noopener\">got_big_numbers.php<\/a><\/p>\n<hr>\n<p id='lpt'>Previous relevant <a target=\"_blank\" title='Lisp Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/lisp-primer-tutorial\/' rel=\"noopener\">Lisp Primer Tutorial<a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Lisp\/\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"Lisp Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Lisp\/Lisp_Primer.jpg\" title=\"Lisp Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Lisp Primer Tutorial<\/p><\/div>\n<p>Have you heard of Lisp, the programming language?  Do you remember how incredible Hewlett Packard calculators were back in the 1970&#8217;s (we did as Land Surveyors &#8230; they were the bee&#8217;s knees, especially to program for those Land Surveying calculations).   And do you (older users) remember the excitement regarding reverse Polish notation?  Well, Lisp, the second oldest high-level language (after Fortran) uses this reverse Polish notation and thinking.<\/p>\n<p>Am no expert with Lisp, as you&#8217;ll see, and we&#8217;ll defer to code available on the net and contributed by others, but have to mention its incredible mathematical scope, for instance, with its functionality for huge numbers (integers).   You will notice with languages like C++ it is not at all easy doing a calculation like the factorial of 1000 &#8230; or 1000! &#8230; or 1000 x 999 x 998 x &#8212;&gt; x 2 x 1 &#8230; but Lisp does it with considerable ease.   As a matter of interest, as far as this type of big integer in Java, you may want to check on the <a target=\"_blank\" title='Good link ... thanks ... with advice about Java BigO data type' href='http:\/\/stackoverflow.com\/questions\/17118210\/big-o-simple-explaining-and-use-in-java' rel=\"noopener\">BigO data type<\/a>.<\/p>\n<p>Today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Lisp\/\" title='Click picture.' rel=\"noopener\">tutorial<\/a> introduces you to Lisp we install using LispWorks Personal on a Mac laptop, and execute a Hello World and some large factorial calculations.   Lisp, being the old language it is, is a very functional language, and although global variables are allowed, the Lisp &#8220;way&#8221; is not to resort to such approaches.<\/p>\n<p>Below are some links regarding Lisp you may want to peruse:<\/p>\n<ul>\n<li><a target=\"_blank\" href='http:\/\/en.wikipedia.org\/wiki\/Lisp_%28programming_language%29' title='Lisp information from Wikipedia' rel=\"noopener\">Lisp<\/a> information from Wikipedia<\/li>\n<li><a target=\"_blank\" href='http:\/\/www.lispworks.com\/downloads\/index.html' title='Download website for Mac' rel=\"noopener\">LispWorks Personal Edition<\/a> for MacBook Pro<\/li>\n<li><a target=\"_blank\" href='http:\/\/cs.gmu.edu\/~sean\/lisp\/LispTutorial.html' title='Lisp Quickstart' rel=\"noopener\">Lisp Quickstart<\/a> where factorial code is from &#8230; thanks<\/li>\n<li><a target=\"_blank\" href='http:\/\/www.cs.sfu.ca\/CourseCentral\/310\/pwfong\/Lisp\/1\/tutorial1.html' title='Basic Lisp Programming Tutorial' rel=\"noopener\">Basic Lisp Programming Tutorial<\/a><\/li>\n<li><a target=\"_blank\" href='http:\/\/www.chemie.fu-berlin.de\/chemnet\/use\/info\/elisp\/elisp_19.html' title='Interactive entry in Lisp' rel=\"noopener\">Interactive entry in Lisp<\/a><\/li>\n<\/ul>\n<p>Will leave you with some downloadable programming Lisp source code you could call <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Lisp\/helloworld.lisp_GETME\" title='helloworld.lisp' rel=\"noopener\">helloworld.lisp<\/a> and some factorial code called <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Lisp\/factorial.lisp_GETME\" title='factorial.lisp' rel=\"noopener\">factorial.lisp<\/a><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7468' onclick='var dv=document.getElementById(\"d7468\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=Fortran\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7468' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d14897' onclick='var dv=document.getElementById(\"d14897\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=PHP\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d14897' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d63696' onclick='var dv=document.getElementById(\"d63696\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/factorial\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d63696' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d64541' onclick='var dv=document.getElementById(\"d64541\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/precision\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64541' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Maths fun &#8220;PHP style&#8221; can be had with the GNU Multiple Precision (GMP) extension with echoes of PHP mathematics work talked about with PHP Bcmath Factorial Tutorial. Again, on this AlmaLinux PHP (starting with 8) environment, we started off with &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-gnu-multiple-precision-mathematics-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,19,1,37],"tags":[4855,179,4843,1797,411,4889,611,613,4890,752,3004,2181,932,1954,3046,3740,3741,997],"class_list":["post-64541","post","type-post","status-publish","format-standard","hentry","category-elearning","category-installers","category-uncategorised","category-tutorials","tag-almalinux","tag-calculation","tag-dnf","tag-extension","tag-factorial","tag-greatest-common-multiple","tag-install","tag-installer","tag-least-common-divisor","tag-mathematics","tag-maths","tag-package-manager","tag-php","tag-power","tag-precision","tag-prime","tag-prime-number","tag-programming"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64541"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=64541"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64541\/revisions"}],"predecessor-version":[{"id":64548,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64541\/revisions\/64548"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=64541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=64541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=64541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}