Namespaces
Variants

acosh, acoshf, acoshl

From cppreference.net
< c ‎ | numeric ‎ | math
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99) (C99) (C99) (C23)
Maximum/minimum operations
Exponential functions
Power functions
Trigonometric and hyperbolic functions
Nearest integer floating-point
(C99) (C99) (C99)
(C23) (C23) (C23) (C23)
Floating-point manipulation
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
Arguments and return values
Error handling
Fast operation indicators
Défini dans l'en-tête <math.h>
float acoshf ( float arg ) ;
(1) (depuis C99)
double acosh ( double arg ) ;
(2) (depuis C99)
long double acoshl ( long double arg ) ;
(3) (depuis C99)
Défini dans l'en-tête <tgmath.h>
#define acosh( arg )
(4) (depuis C99)
1-3) Calcule le cosinus hyperbolique inverse de arg .
4) Macro générique de type : Si l'argument a le type long double , acoshl est appelé. Sinon, si l'argument a un type entier ou le type double , acosh est appelé. Sinon, acoshf est appelé. Si l'argument est complexe, alors la macro appelle la fonction complexe correspondante ( cacoshf , cacosh , cacoshl ).

Table des matières

Paramètres

arg - valeur en virgule flottante représentant l'aire d'un secteur hyperbolique

Valeur de retour

Si aucune erreur ne se produit, le cosinus hyperbolique inverse de arg ( cosh -1
(arg)
, ou arcosh(arg) ) sur l'intervalle [0, +∞] , est retourné.

Si une erreur de domaine se produit, une valeur définie par l'implémentation est retournée (NaN là où supporté).

Gestion des erreurs

Les erreurs sont signalées comme spécifié dans math_errhandling .

Si l'argument est inférieur à 1 , une erreur de domaine se produit.

Si l'implémentation prend en charge l'arithmétique à virgule flottante IEEE (IEC 60559),

  • Si l'argument est inférieur à 1, FE_INVALID est déclenchée et NaN est retourné.
  • Si l'argument est 1, +0 est retourné.
  • Si l'argument est +∞, +∞ est retourné.
  • Si l'argument est NaN, NaN est retourné.

Notes

Bien que la norme C nomme cette fonction « cosinus hyperbolique inverse », les fonctions inverses des fonctions hyperboliques sont les fonctions d'aire. Leur argument est l'aire d'un secteur hyperbolique, et non un arc. Le nom correct est « cosinus hyperbolique inverse » (utilisé par POSIX) ou « cosinus hyperbolique d'aire ».

Exemple

#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
// #pragma STDC FENV_ACCESS ON
int main(void)
{
    printf("acosh(1) = %f\nacosh(10) = %f\n", acosh(1), acosh(10));
    printf("acosh(DBL_MAX) = %f\nacosh(Inf) = %f\n", acosh(DBL_MAX), acosh(INFINITY));
    // error handling
    errno = 0; feclearexcept(FE_ALL_EXCEPT);
    printf("acosh(0.5) = %f\n", acosh(0.5));
    if (errno == EDOM)
        perror("    errno == EDOM");
    if (fetestexcept(FE_INVALID))
        puts("    FE_INVALID raised");
}

Sortie possible :

acosh(1) = 0.000000
acosh(10) = 2.993223
acosh(DBL_MAX) = 710.475860
acosh(Inf) = inf
acosh(0.5) = -nan
    errno == EDOM: Numerical argument out of domain
    FE_INVALID raised

Références

  • Norme C23 (ISO/CEI 9899:2024) :
  • 7.12.5.1 Les fonctions acosh (p: TBD)
  • 7.27 Mathématiques génériques <tgmath.h> (p: TBD)
  • F.10.2.1 Les fonctions acosh (p: TBD)
  • Norme C17 (ISO/CEI 9899:2018) :
  • 7.12.5.1 Les fonctions acosh (p: 175)
  • 7.25 Mathématiques génériques <tgmath.h> (p: 272-273)
  • F.10.2.1 Les fonctions acosh (p: 379)
  • Norme C11 (ISO/CEI 9899:2011) :
  • 7.12.5.1 Les fonctions acosh (p: 240)
  • 7.25 Mathématiques génériques <tgmath.h> (p: 373-375)
  • F.10.2.1 Les fonctions acosh (p: 520)
  • Norme C99 (ISO/CEI 9899:1999) :
  • 7.12.5.1 Les fonctions acosh (p : 221)
  • 7.22 Mathématiques génériques de type <tgmath.h> (p : 335-337)
  • F.9.2.1 Les fonctions acosh (p : 457)

Voir aussi

(C99) (C99) (C99)
calcule le sinus hyperbolique inverse ( arsinh(x) )
(fonction)
(C99) (C99) (C99)
calcule la tangente hyperbolique inverse ( artanh(x) )
(fonction)
(C99) (C99)
calcule le cosinus hyperbolique ( cosh(x) )
(fonction)
(C99) (C99) (C99)
calcule l'arc cosinus hyperbolique complexe
(fonction)

Liens externes

Weisstein, Eric W. "Inverse Hyperbolic Cosine." De MathWorld — Une ressource web Wolfram.