O'Reilly logo

PHP 5 Recipes: A Problem-Solution Approach by Jon Stephens, Frank M. Kromann, Nathan A. Good, Lee Babin

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

CHAPTER 3Performing Math Operations

Math is one of the fundamental elements of most programming languages. Math allows the programmer to perform anything from simple additions to advanced calculations. Even though PHP was designed to create dynamic Hypertext Markup Language (HTML) documents, it has evolved to a general-purpose programming language that includes a strong and flexible math implementation.

The implementation of math in PHP looks very much like the implementation in C. In fact, many of the functions are implemented as simple wrappers around the math functions found in C libraries.

3-1. Numeric Data Types

Working with numbers or numeric data and math functions in PHP is simple. Basically, you have two data types to work with, floating ...

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