Namespaces
Variants

atan, atanf, atanl

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 atanf ( float arg ) ;
(1) (depuis C99)
double atan ( double arg ) ;
(2)
long double atanl ( long double arg ) ;
(3) (depuis C99)
_Decimal32  atand32 ( _Decimal32 arg ) ;
(4) (depuis C23)
_Decimal64  atand64 ( _Decimal64 arg ) ;
(5) (depuis C23)
_Decimal128 atand128 ( _Decimal128 arg ) ;
(6) (depuis C23)
Défini dans l'en-tête <tgmath.h>
#define atan( arg )
(7) (depuis C99)
1-6) Calcule la valeur principale de l'arc tangente de arg .
7) Macro générique de type : Si l'argument a le type long double , (3) ( atanl ) est appelé. Sinon, si l'argument a un type entier ou le type double , (2) ( atan ) est appelé. Sinon, (1) ( atanf ) est appelé. Si l'argument est complexe, alors la macro appelle la fonction complexe correspondante ( catanf , catan , catanl ).

Les fonctions (4-6) sont déclarées si et seulement si l'implémentation prédéfinit __STDC_IEC_60559_DFP__ (c'est-à-dire que l'implémentation prend en charge les nombres à virgule flottante décimale).

(depuis C23)

Table des matières

Paramètres

arg - valeur à virgule flottante

Valeur de retour

If no errors occur, the arc tangent of arg ( arctan(arg) ) in the range [-
π
2
; +
π
2
]
radians, is returned.

Si une erreur de plage se produit en raison d'un dépassement inférieur, le résultat correct (après arrondi) est retourné.

Gestion des erreurs

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

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

  • si l'argument est ±0, il est retourné inchangé ;
  • si l'argument est +∞, +π/2 est retourné ;
  • si l'argument est -∞, -π/2 est retourné ;
  • si l'argument est NaN, NaN est retourné.

Notes

POSIX spécifie qu'en cas de dépassement inférieur, arg est retourné non modifié, et si cela n'est pas supporté, une valeur définie par l'implémentation non supérieure à DBL_MIN , FLT_MIN , et LDBL_MIN est retournée.

Exemple

#include <math.h>
#include <stdio.h>
int main(void)
{
    printf("atan(1) = %f, 4*atan(1)=%f\n", atan(1), 4 * atan(1));
    // special values
    printf("atan(Inf) = %f, 2*atan(Inf) = %f\n", atan(INFINITY), 2 * atan(INFINITY));
    printf("atan(-0.0) = %+f, atan(+0.0) = %+f\n", atan(-0.0), atan(0));
}

Sortie :

atan(1) = 0.785398, 4*atan(1)=3.141593
atan(Inf) = 1.570796, 2*atan(Inf) = 3.141593
atan(-0.0) = -0.000000, atan(+0.0) = +0.000000

Références

  • Norme C23 (ISO/IEC 9899:2024):
  • 7.12.4.3 Les fonctions atan (p: TBD)
  • 7.25 Mathématiques génériques de type <tgmath.h> (p: TBD)
  • F.10.1.3 Les fonctions atan (p: TBD)
  • Norme C17 (ISO/CEI 9899:2018) :
  • 7.12.4.3 Les fonctions atan (p: 174)
  • 7.25 Mathématiques génériques de type <tgmath.h> (p: 272-273)
  • F.10.1.3 Les fonctions atan (p: 378)
  • Norme C11 (ISO/CEI 9899:2011) :
  • 7.12.4.3 Les fonctions atan (p: 238-239)
  • 7.25 Mathématiques génériques de type <tgmath.h> (p: 373-375)
  • F.10.1.3 Les fonctions atan (p: 519)
  • Norme C99 (ISO/CEI 9899:1999) :
  • 7.12.4.3 Les fonctions atan (p : 219)
  • 7.22 Mathématiques génériques de type <tgmath.h> (p : 335-337)
  • F.9.1.3 Les fonctions atan (p : 456)
  • Norme C89/C90 (ISO/IEC 9899:1990) :
  • 4.5.2.3 Fonction atan

Voir aussi

calcule l'arc tangente, en utilisant les signes pour déterminer les quadrants
(fonction)
(C99) (C99)
calcule l'arc sinus ( arcsin(x) )
(fonction)
(C99) (C99)
calcule l'arc cosinus ( arccos(x) )
(fonction)
(C99) (C99)
calcule la tangente ( tan(x) )
(fonction)
(C99) (C99) (C99)
calcule l'arc tangente complexe
(fonction)