PHP 8.5.0 Beta 3 available for testing

abs

(PHP 4, PHP 5, PHP 7, PHP 8)

abs β€” Valore assoluto

Descrizione

abs(mixed $numero): number

Restituisce il valore assoluto di un numero. Se l'argomento della funzione Γ¨ di tipo float, il valore restituito Γ¨ float, altrimenti restituisce un integer (perchΓ© float di solito ha un range di valori piΓΉ grande di integer).

Example #1 Esempio di abs()

<?php
$abs
= abs(-4.2); // $abs = 4.2; (double/float)
$abs2 = abs(5); // $abs2 = 5; (integer)
$abs3 = abs(-5); // $abs3 = 5; (integer)
?>
οΌ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top