Type-generic math
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
El
<tgmath.h> cabecera incluye las cabeceras <math.h> y <complex.h> y define varias de tipo genérico macros. Estas macros determina la función real para llamar dependiendo de los tipos de los parámetros .Original:
The header
<tgmath.h> includes the headers <math.h> and <complex.h> and defines several type-generic macros. These macros determines the actual function to call depending on the types of the parameters.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Trigonométricas, hiperbólicas poder y las funciones exponenciales NJ
A
XXX macro de tipo genérico llamadas de: aOriginal:
A type-generic macro
XXX calls either of:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- verdadera función:Original:real function:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
floatvarianteXXXfOriginal:floatvariantXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.doublevarianteXXXOriginal:doublevariantXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.long doublevarianteXXXlOriginal:long doublevariantXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- compleja función:Original:complex function:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
floatvariantecXXXfOriginal:floatvariantcXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.doublevariantecXXXOriginal:doublevariantcXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.long doublevariantecXXXlOriginal:long doublevariantcXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Una excepción a la regla anterior es
exp (ver tabla a continuación) .Original:
An exception to the above rule is
exp (see the table below).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
La función de llamada se determina de la siguiente manera:
Original:
The function to call is determined as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- Si alguno de los parámetros es complejo, entonces la función compleja que se llama, de lo contrario la función real se llama .Original:If any of the parameters is complex, then the complex function is called, otherwise the real function is called.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Si alguno de los parámetros es
long double, entonces la variantelong doublese llama. De lo contrario, si cualquiera de los parámetros esdouble, entonces la variantedoublese llama. De lo contrario, la variantefloatse llama .Original:If any of the parameters islong double, then thelong doublevariant is called. Otherwise, if any of the parameters isdouble, then thedoublevariant is called. Otherwise,floatvariant is called.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - El comportamiento es indefinido es cualquiera de los parámetros es incompatible con el argumento de la función correspondiente.
Esta sección está incompleta
Razón: what's meant by incompatible?Original:The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.Esta sección está incompleta
Razón: what's meant by incompatible?The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Las macros de tipo genéricos son los siguientes:
Original:
The type-generic macros are as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
| Type-generic macro | Real function variants |
Complex function variants | ||||
|---|---|---|---|---|---|---|
float |
double |
long double |
float |
double |
long double | |
| asin | asinf | asin | asinl | casinf | casin | casinl |
| acos | acosf | acos | acosl | cacosf | cacos | cacosl |
| atan | atanf | atan | atanl | catanf | catan | catanl |
| asinh | asinhf | asinh | asinhl | casinhf | casinh | casinhl |
| acosh | acoshf | acosh | acoshl | cacoshf | cacosh | cacoshl |
| atanh | atanhf | atanh | atanhl | catanhf | catanh | catanhl |
| sin | sinf | sin | sinl | csinf | csin | csinl |
| cos | cosf | cos | cosl | ccosf | ccos | ccosl |
| tan | tanf | tan | tanl | ctanf | ctan | ctanl |
| sinh | sinhf | sinh | sinhl | csinhf | csinh | csinhl |
| cosh | coshf | cosh | coshl | ccoshf | ccosh | ccoshl |
| tanh | tanhf | tanh | tanhl | ctanhf | ctanh | ctanhl |
| exp | expf | exp | expl | cexpf | cexp | cexpl |
| log | logf | log | logl | clogf | clog | clogl |
| pow | powf | pow | powl | cpowf | cpow | cpowl |
| sqrt | sqrtf | sqrt | sqrtl | csqrtf | csqrt | csqrtl |
| abs | fabsf | fabs | fabsl | cabsf | cabs | cabsl |
| exp | expf | exp | expl | cexpf | cexp | cexpl |
Funciones NJ Varios
A
XXX macro de tipo genérico llama cualquiera de las variantes de una función real:Original:
A type-generic macro
XXX calls either of the variants of a real function:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
floatvarianteXXXfOriginal:floatvariantXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.doublevarianteXXXOriginal:doublevariantXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.long doublevarianteXXXlOriginal:long doublevariantXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tenga en cuenta, no hay
modf de tipo genérico macro .Original:
Note, there's no
modf type-generic macro.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
La función de llamada se determina de la siguiente manera:
Original:
The function to call is determined as follows:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
- Si alguno de los parámetros es
long double, entonces la variantelong doublese llama. De lo contrario, si cualquiera de los parámetros esdouble, entonces la variantedoublese llama. De lo contrario, la variantefloatse llama .Original:If any of the parameters islong double, then thelong doublevariant is called. Otherwise, if any of the parameters isdouble, then thedoublevariant is called. Otherwise,floatvariant is called.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - El comportamiento es indefinido es cualquiera de los parámetros es incompatible con el argumento de la función correspondiente.
Esta sección está incompleta
Razón: what's meant by incompatible?Original:The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.Esta sección está incompleta
Razón: what's meant by incompatible?The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ejemplo
Ejecuta este código
int i;
float f;
double d;
long double ld;
float complex fc;
double complex dc;
long double complex ldc;
// macro -> function call
cos(i); // -> cos(i)
sin(f); // -> sinf(f)
acos(d); // -> acos(d)
sqrt(dc); // -> csqrt(dc);