© Frank M. Kromann 2016

Frank M. Kromann, PHP and MySQL Recipes, 10.1007/978-1-4842-0605-8_3

3. Performing Math Operations

Frank M. Kromann

(1)Trabuco Canyon, California, USA

A large number of math functions are built in to the core of PHP and additional functionality is available through extensions including arbitrary precision numbers, statistics, and linear algebra.

The built-in functions cover exponential, logarithmic, trigonometric, hyperbolic functions as well as rounding and random number generators.

PHP supports integer and float data types that can be used to perform the basic math operations: addition (+), subtraction (-), multiplication (*), and division (/). No special functions are needed to perform these actions and the logic can be ...

Get PHP and MySQL Recipes: A Problem-Solution Approach, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.