Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Floating Point Numbers

Floating point numbers, also known as floats, doubles, or real numbers, can be specified using a decimal dot and a mantis.

They may also use a number separator _: it may be placed anywhere between two digits, to help make the number more readable.

Floats used to be called real, though this was abandoned progressively, since PHP 7.0.

<?php

    $a = 1.234; 
    $b = 1.2e3; 
    $c = 7E-10;
    $d = 1_234.567; // as of PHP 7.4.0

?>

Documentation

See Also