PHP Bcmath Primer Tutorial

PHP Bcmath Primer Tutorial

PHP Bcmath Primer Tutorial

Today we have an unusual linkage of tutorials, where we link our tutorial here, today, called “PHP Bcmath Primer Tutorial” with one from some time back (and I.T. historically speaking, a really long way back) called Lisp Primer Tutorial as shown below.

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 “bcmath” module in PHP, that we use for the purpose here today, uses “strings” to achieve the affect, so that I don’t believe there are any times during the calculations, necessarily, with the CPU register, 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.

We throw into the mix a bit of fun and games … 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 Google Translate functionality in order for you to, optionally (and not always … no go with Firefox for instance), hear the results in those great mellifluous tones (in English, as default).

Hope you really give some curly questions out there to the live run. Here is the PHP source code using the “bcmath” module you could call got_big_numbers.php


Previous relevant Lisp Primer Tutorial is shown below.

Lisp Primer Tutorial

Lisp Primer Tutorial

Have you heard of Lisp, the programming language? Do you remember how incredible Hewlett Packard calculators were back in the 1970’s (we did as Land Surveyors … they were the bee’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.

Am no expert with Lisp, as you’ll see, and we’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 … or 1000! … or 1000 x 999 x 998 x —> x 2 x 1 … 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 BigO data type.

Today’s tutorial 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 “way” is not to resort to such approaches.

Below are some links regarding Lisp you may want to peruse:

Will leave you with some downloadable programming Lisp source code you could call helloworld.lisp and some factorial code called factorial.lisp

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Tutorials and tagged , , , , , , , , , , . Bookmark the permalink.

2 Responses to PHP Bcmath Primer Tutorial

  1. sell tshirts says:

    Great goods from you, man. I’ve have in mind your stuff previous to and you’re just extremely great.

    I actually like what you’ve received here, certainly like what you’re saying and the best way wherein you say it.

    You make it enjoyable and you still care for to stay it sensible.
    I cant wait to read much more from you. That is actually a wonderful website.

  2. This piece of writing is genuinely a nice one it helps new internet visitors, who are wishing for blogging.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>