O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.3. Arbitrary-Precision Numbers

Doubles are usually sufficiently precise for any numerical analysis you may wish to perform. However, PHP offers a way to work with numbers of much higher precision. The functions in this section use strings to store very long floating-point numbers. They each use a scale value that is the number of digits to the right of the decimal point. The scale argument that appears in all of the functions is optional and will override the default scale. The bcscale function, described in Chapter 15, sets the default scale.

These functions are part of the bcmath extension. They are part of the binary distribution for Windows, but they are not activated by default for other operating systems. If PHP reports these functions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required