tan, tanf, tanh, tanhf

Calcula la tangente (tan o tanf) o la tangente hiperbólica (tanh o tanhf).

double tan(
   double x 
);
float tan(
   float x 
);  // C++ only
long double tan(
   long double x
);  // C++ only
float tanf(
   float x 
);
double tanh(
   double x 
);
float tanh(
   float x 
);  // C++ only
long double tanh(
   long double x
);  // C++ only
float tanhf(
   float x 
);

Parámetros

  • x
    ángulo en radianes.

Valor devuelto

tan devuelve la tangente de x.Si x es mayor o igual que 263, o inferior o igual a 263, una pérdida de significado en el resultado aparece.

Entrada

ELLA excepción

Matherr Exception

± QNAN, IND

nada

_DOMAIN

± ∞ (tan, tanf)

INVALID

_DOMAIN

tanh devuelve la tangente hiperbólica de x.No hay retorno de error.

Comentarios

C++ permite la sobrecarga, por lo que los usuarios pueden llamar a las sobrecargas de tan y de tanh que toman float o tipos double largos.En un programa de c., las funciones de tan y de tanh toman y siempre devuelven el doble.

Requisitos

rutina

Encabezado necesario

tan, tanf, tanh, tanhf

<math.h>

Para obtener información adicional de compatibilidad, vea compatibilidad en la Introducción.

Ejemplo

// crt_tan.c
// This program displays the tangent of pi / 4
// and the hyperbolic tangent of the result.
//

#include <math.h>
#include <stdio.h>

int main( void )
{
   double pi = 3.1415926535;
   double x, y;

   x = tan( pi / 4 );
   y = tanh( x );
   printf( "tan( %f ) = %f\n", pi/4, x );
   printf( "tanh( %f ) = %f\n", x, y );
}
  

Equivalente en .NET Framework

Vea también

Referencia

Compatibilidad de punto flotante

Doble largo

acos, acosf

asin, asinf

atan, atanf, atan2, atan2f

cos, cosf, garrote, coshf

sin, sinf, sinh, sinhf

_CItan