Perl Language Reference Manualby Larry Wall and others Paperback (6"x9"), 724 pages ISBN 9781906966027 RRP £29.95 ($39.95) Sales of this book support The Perl Foundation! Get a printed copy>>> |

# 6 perlnumber: Semantics of numbers and numeric operations

$n = 1234; # decimal integer $n = 0b1110011; # binary integer $n = 01234; # octal integer $n = 0x1234; # hexadecimal integer $n = 12.34e-56; # exponential notation $n = "-12.34e56"; # number specified as a string $n = "1234"; # number specified as a string

This document describes how Perl internally handles numeric values.

Perl's operator overloading facility is completely ignored here. Operator
overloading allows user-defined behaviors for numbers, such as operations
over arbitrarily large integers, floating points numbers with arbitrary
precision, operations over "exotic" numbers such as modular arithmetic or
p-adic arithmetic, and so on. See "Package for overloading Perl operations" (overload) in the *Perl Library Reference Manual (Volume 1)* for details.

ISBN 9781906966027 | Perl Language Reference Manual | See the print edition |