expm1

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

expm1 Restituisce exp(numero) - 1, computato in maniera tale da essere accurato anche se il valore del numero è vicino a zero

Description

expm1(float $number): float
Avviso

Questa funzione è SPERIMENTALE. Ovvero, il comportamento di questa funzione, il nome di questa funzione, in definitiva tutto ciò che è documentato qui può cambiare nei futuri rilasci del PHP senza preavviso. Siete avvisati, l'uso di questa funzione è a vostro rischio.

Avviso

Questa funzione, al momento non è documentata; è disponibile soltanto la lista degli argomenti.

Nota: Questa funzione non è implementata sulle piattaforme Windows.

add a note add a note

User Contributed Notes 2 notes

up
-1
brettz9 AAT yah
15 years ago
Note that exp(x)-1 can be approximated by x + x^2/2! + ... + x^n/n!  and for any value
up
-1
hagen at von-eitzen dot de
21 years ago
Compare this to log1p (which is its inverse).

Also, You may have to use a similar workaraound in case the underlying C library
does not support expm1:

<?php
function expm1($x) {
     return (
$x>-1.0e-6 && $x<1.0e-6) ? ($x + $x*$x/2) : (exp($x)-1);
}
?>
To Top