Tan, tanf, tanh, tanhf

Calcular a tangente (tan ou tanf) ou a tangente hiperbólica (tanh ou 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 em radianos.

Valor de retorno

tanRetorna a tangente de x.Se x é maior que ou igual a 263 ou menor que ou igual a –263, uma perda de significância no resultado ocorre.

Entrada

Exceção SEH

MatherrExceção

± QNAN, IND.

Nenhum

_DOMAIN

± ∞ (tan, tanf)

INVALID

_DOMAIN

tanhRetorna a tangente hiperbólica de x.Não há nenhum retorno de erro.

Comentários

C++ permite que sobrecarga, para que os usuários podem chamar métodos sobrecarregados de tan e tanh que levam o float ou tipos long double.Em um programa em C, o tan e tanh funções sempre usam e retornam duplas.

Requisitos

Rotina

Cabeçalho necessário

tan, tanf, tanh, tanhf

<math.h>

Para obter informações adicionais de compatibilidade, consulte compatibilidade na introdução.

Exemplo

// 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 );
}
  

Equivalência do .NET Framework

Consulte também

Referência

Suporte de ponto flutuante

Long Double

ACOS, acosf

ASIN, asinf

ATAN, atanf, atan2, atan2f

CoS, cosf, cosh, coshf

sin, sinf, sinh, sinhf

_CItan