erf, erff, erfl, erfc, erfcf, erfcl

Calcola la funzione di errore o la funzione di errore complementare di un valore.

Sintassi

double erf(
   double x
);
float erf(
   float x
); // C++ only
long double erf(
   long double x
); // C++ only
float erff(
   float x
);
long double erfl(
   long double x
);
double erfc(
   double x
);
float erfc(
   float x
); // C++ only
long double erfc(
   long double x
); // C++ only
float erfcf(
   float x
);
long double erfcl(
   long double x
);
#define erf(X) // Requires C11 or higher
#define erfc(X) // Requires C11 or higher

Parametri

x
Un valore a virgola mobile.

Valore restituito

Le funzioni erf restituiscono la funzione di errore di Gauss di x. Le funzioni erfc restituiscono la funzione di errore di Gauss complementare di x.

Osservazioni:

Le erf funzioni calcolano la funzione di errore Gauss di x, definita come:

The error function of x equals two over the square root of pi times the integral from zero to x of e to the minus t squared d t.

La funzione di errore Gauss complementare è definita come 1 - erf(x). Le funzioni erf restituiscono un valore compreso tra -1,0 e 1,0. Non viene restituito alcun errore. Le funzioni erfc restituiscono un valore compreso tra 0 e 2. Se x è troppo grande per erfc, la variabile errno è impostata su ERANGE.

Poiché C++ consente l'overload, è possibile chiamare erf e erfc overload che accettano e restituiscono float tipi e long double . In un programma C, a meno che non si usi la <macro tgmath.h> per chiamare questa funzione erf e erfc accettare e restituire sempre .double

Se si utilizza la <macro tgmath.h>erf() , il tipo dell'argomento determina quale versione della funzione è selezionata. Per informazioni dettagliate, vedere La matematica generica dei tipi.

Per impostazione predefinita, lo stato globale di questa funzione è limitato all'applicazione. Per modificare questo comportamento, vedere Stato globale in CRT.

Requisiti

Funzione Intestazione obbligatoria
erf, erff, erfl, erfc, erfcf, erfcl <math.h>
erf Macro <tgmath.h>

Per altre informazioni sulla compatibilità, vedere Compatibility (Compatibilità).

Vedi anche

Supporto matematico e a virgola mobile