Note that pow(0, 0) equals to 1 although mathematically this is undefined.(PHP 4, PHP 5, PHP 7, PHP 8)
pow — Espressione esponenziale
Restituisce base elevato alla potenza di
esp. Se possibile, questa funzione restituisce
un integer.
Se la potenza non può essere computata, viene generato un errore,
e pow() restituirà false. dalla versione 4.2.0 di PHP
la funzione pow() non genera alcun warning.
Nota:
Il PHP non può gestire valori negativi per
bases.
Example #1 Alcuni esempi di pow()
<?php
var_dump( pow(2,8)); // int(256)
echo pow(-1, 20); // 1
echo pow(0, 0); // 1
echo pow(-1, 5.5); // errore
?>Nel PHP 4.0.6 e precedenti, pow() restituiva sempre un float e non generava alcun errore.
Note that pow(0, 0) equals to 1 although mathematically this is undefined.