45 lines
1.4 KiB
Markdown
45 lines
1.4 KiB
Markdown
# Fonctions mathématiques
|
|
|
|
Chaque fonction est déclinée en fonction du type de données utilisé pour le paramètre et la valeur de retour : double, float ou long double.
|
|
|
|
## Fonctions de calculs d'arrondis
|
|
|
|
Fonction | double | float | long double
|
|
---|---|--- | ---
|
|
Arrondi à l'entier le plus proche | `round` | `roundf` | `roundl`
|
|
Arrondi entier supérieur | `ceil` | `ceilf` | `ceill`
|
|
Arrondi entier inférieur | `floor` | `floorf` | `floorl`
|
|
Extraire la partie entière | `trunc` | `truncf` | `truncl`
|
|
|
|
> [!WARNING]
|
|
> Attention aux valeurs négatives ! La valeur plancher de -5.21 est -6 car -6 est inférieure à -5.21.
|
|
|
|
## Fonctions exponentielles et logarithmiques
|
|
|
|
Fonction | double | float | long double
|
|
---|---|--- | ---
|
|
Exponnentielle $e^{x}$ | `exp` | `expf` | `expl`
|
|
Logarithme naturel | `log` | `logf` | `logl`
|
|
|
|
## Fonctions trigonométriques
|
|
|
|
Fonction | double | float | long double
|
|
---|---|--- | ---
|
|
Cosinus | `cos` | `cosf` | `cosl`
|
|
Sinus | `sin` | `sinf` | `sinl`
|
|
Tangente | `tan` | `tanf` | `tanl`
|
|
Arc cosinus | `acos` | `acosf` | `acosl`
|
|
Arc sinus | `asin` | `asinf` | `asinl`
|
|
Arc tangente | `atan` | `atanf` | `atanl`
|
|
|
|
## Fonctions hyperboliques
|
|
|
|
Fonction | double | float | long double
|
|
---|---|--- | ---
|
|
Cosinus | `cosh` | `coshf` | `coshl`
|
|
Sinus | `sinh` | `sinhf` | `sinhl`
|
|
Tangente | `tanh` | `tanhf` | `tanhl`
|
|
Arc cosinus | `acosh` | `acoshf` | `acoshl`
|
|
Arc sinus | `asinh` | `asinhf` | `asinhl`
|
|
Arc tangente | `atanh` | `atanhf` | `atanhl`
|