Espacios de nombres
Variantes
Acciones

Diferencia entre revisiones de «cpp/numeric/math/tanh»

De cppreference.com
< cpp‎ | numeric‎ | math
(Translated from the English version using Google Translate)
 
(actualización)
 
(No se muestran 6 ediciones intermedias realizadas por 3 usuarios)
Línea 1: Línea 1:
{{cpp/title|tanh}}
+
{{cpp/title|tanh}}
 
{{cpp/numeric/math/navbar}}
 
{{cpp/numeric/math/navbar}}
{{ddcl list begin}}
+
{{begin}}
{{ddcl list header | cmath}}
+
{{header | cmath}}
{{ddcl list item |
+
{{|
float      tanh( float arg );
+
 +
float      tanh
 +
 +
( float arg );
 
}}
 
}}
{{ddcl list item |
+
{{|
double      tanh( double arg );
+
double      tanh ( double arg );
 
}}
 
}}
{{ddcl list item |
+
{{|
long double tanh( long double arg );
+
 +
long double tanh
 +
 +
( long double arg );
 
}}
 
}}
{{ddcl list item | notes={{mark since c++11}} |
+
{{| sincec++11 |
double      tanh( Integral arg );
+
double      tanh ( arg );
 
}}
 
}}
{{ddcl list end}}
+
{{end}}
  
{{tr|Calcula la tangente hiperbólica de {{tt|arg}}|Computes hyperbolic tangent of {{tt|arg}}}}
+
Calcula la tangente hiperbólica de {{tt|arg}}
 +
|{{|}} }}
  
 
===Parámetros===
 
===Parámetros===
{{param list begin}}
+
{{begin}}
{{param list item | arg |{{tr| flotando valor en puntos| floating point value}}}}
+
{{| arg | |}}
{{param list end}}
+
{{end}}
  
 
===Valor de retorno===
 
===Valor de retorno===
{{tr|tangente hiperbólica de {{tt|arg}}|hyperbolic tangent of {{tt|arg}}}}
+
tangente hiperbólica de {{tt|arg}} |{{|arg}}}}
  
===Ver también===
+
{{dcl list begin}}
+
{{dcl list template | cpp/numeric/math/dcl list sinh}}
+
{{dcl list template | cpp/numeric/math/dcl list cosh}}
+
{{dcl list template | cpp/numeric/math/dcl list atanh}}
+
{{dcl list template | cpp/numeric/complex/dcl list tanh}}
+
{{dcl list template | cpp/numeric/valarray/dcl list tanh}}
+
{{dcl list end}}
+
  
[[fr:cpp/numeric/math/tanh]]
+
[[ja:cpp/numeric/math/tanh]]
+
[[pl:cpp/numeric/math/tanh]]
+
 
[[pt:cpp/numeric/math/tanh]]
+
[[zh:cpp/numeric/math/tanh]]
+
 +
 +
 +
 
 +
 +
[:///tanh]
 +
 
 +
 +
 +
 +
 +
 
 +
 +
 +
:
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 
 +
 +
 +
cpp/numeric/math/
 +
cpp/numeric/math/
 +
cpp/numeric/math/
 +
tanh
 +
cpp
 +
/numeric/math/tanh
 +
 +
 
 +

Última revisión de 16:22 10 abr 2022

 
 
 
Funciones matemáticas comunes
Funciones
Operaciones básicas
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Funciones exponenciales
(C++11)
(C++11)
(C++11)
(C++11)
Funciones de potencias
(C++11)
(C++11)
Funciones trigonométricas e hiperbólicas
tanh
(C++11)
(C++11)
(C++11)
Funciones de error y gamma
(C++11)
(C++11)
(C++11)
(C++11)
Operaciones de punto flotante del entero más cercano
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
Funciones de manipulación de punto flotante
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
Clasificación/comparación
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Constantes de macro
(C++11)(C++11)(C++11)(C++11)(C++11)
 
Definido en el archivo de encabezado <cmath>
(1)
float       tanh ( float arg );
float       tanhf( float arg );
(desde C++11)
double      tanh ( double arg );
(2)
(3)
long double tanh ( long double arg );
long double tanhl( long double arg );
(desde C++11)
double      tanh ( TipoEntero arg );
(4) (desde C++11)
1-3) Calcula la tangente hiperbólica de arg.
4) Un conjunto de sobrecargas o una plantilla de función que acepta un argumento de cualquier tipo entero. Equivalente a (2) (el argumento se convierte a double).

Contenido

[editar] Parámetros

arg - Valor de un tipo de punto flotante o un tipo entero.

[editar] Valor de retorno

Si no se producen errores, se devuelve la tangente hiperbólica de arg (tanh(arg), o
earg
-e-arg
earg
+e-arg
).

Si se produce un error debido a subdesbordamiento, se devuelve el resultado correcto (después del redondeo).

[editar] Manejo de errores

Los errores se informan como se especifica en math_errhandling.

Si la implementación admite la aritmética de punto flotante IEEE (IEC 60559):

  • Si el argumento es +0 o -0, se devuelve +0 o -0, respectivamente.
  • Si el argumento es +∞ o -∞, se devuelve +1 o -1, respectivamente.
  • Si el argumento es NaN, se devuelve NaN.

[editar] Notas

POSIX especifica que en caso de subdesbordamiento, se devuelva arg sin modificar, y si no se admite, se devuelva un valor definido por la implementación no mayor que DBL_MIN, FLT_MIN y LDBL_MIN.

[editar] Ejemplo

#include <iostream>
#include <cmath>
 
int main()
{
    std::cout << std::showpos
              << "tanh(+1) = " << std::tanh(+1) << '\n'
              << "tanh(-1) = " << std::tanh(-1) << '\n'
              << "tanh(0.1)*sinh(0.2)-cosh(0.2) = "
              << std::tanh(0.1) * std::sinh(0.2) - std::cosh(0.2) << '\n'
              // valores especiales:
              << "tanh(+0) = " << std::tanh(+0.0) << '\n'
              << "tanh(-0) = " << std::tanh(-0.0) << '\n';
}

Salida:

tanh(+1) = +0.761594
tanh(-1) = -0.761594
tanh(0.1)*sinh(0.2)-cosh(0.2) = -1
tanh(+0) = +0
tanh(-0) = -0

[editar] Véase también

(C++11)(C++11)
Calcula el seno hiperbólico (sinh(x))
(función) [editar]
(C++11)(C++11)
Calcula el coseno hiperbólico (cosh(x))
(función) [editar]
(C++11)(C++11)(C++11)
Calcula la tangente hiperbólica inversa (artanh(x))
(función) [editar]
Calcula tangente hiperbólica de un número complejo (tanh(z)).
(plantilla de función) [editar]
se aplica la std::tanh función a cada elemento de valarray
Original:
applies the function std::tanh to each element of valarray
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de función) [editar]