Espacios de nombres
Variantes
Acciones

Type-generic math

De cppreference.com
< c‎ | numeric
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.

[editar]Trigonométricas, hiperbólicas poder y las funciones exponenciales NJ

A XXX macro de tipo genérico llamadas de: a
Original:
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.
  • 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.
  • float variante XXXf
    Original:
    float variant XXXf
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • double variante XXX
    Original:
    double variant XXX
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • longdouble variante XXXl
    Original:
    longdouble variant XXXl
    The 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.
  • float variante cXXXf
    Original:
    float variant cXXXf
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • double variante cXXX
    Original:
    double variant cXXX
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • longdouble variante cXXXl
    Original:
    longdouble variant cXXXl
    The 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.
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.
  • 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 longdouble, entonces la variante longdouble se llama. De lo contrario, si cualquiera de los parámetros es double, entonces la variante double se llama. De lo contrario, la variante float se llama .
    Original:
    If any of the parameters is longdouble, then the longdouble variant is called. Otherwise, if any of the parameters is double, then the double variant is called. Otherwise, float variant 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.
    Original:
    The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.
    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.
Type-generic macro Real function
variants
Complex function
variants
 
float
double
longdouble
float
double
longdouble
asin asinfasinasinlcasinfcasincasinl
acos acosfacosacoslcacosfcacoscacosl
atan atanfatanatanlcatanfcatancatanl
asinh asinhfasinhasinhlcasinhfcasinhcasinhl
acosh acoshfacoshacoshlcacoshfcacoshcacoshl
atanh atanhfatanhatanhlcatanhfcatanhcatanhl
sin sinfsinsinlcsinfcsincsinl
cos cosfcoscoslccosfccosccosl
tan tanftantanlctanfctanctanl
sinh sinhfsinhsinhlcsinhfcsinhcsinhl
cosh coshfcoshcoshlccoshfccoshccoshl
tanh tanhftanhtanhlctanhfctanhctanhl
exp expfexpexplcexpfcexpcexpl
log logflogloglclogfclogclogl
pow powfpowpowlcpowfcpowcpowl
sqrt sqrtfsqrtsqrtlcsqrtfcsqrtcsqrtl
abs fabsffabsfabslcabsfcabscabsl
exp expfexpexplcexpfcexpcexpl

[editar]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.
  • float variante XXXf
    Original:
    float variant XXXf
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • double variante XXX
    Original:
    double variant XXX
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • longdouble variante XXXl
    Original:
    longdouble variant XXXl
    The 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.
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.
  • Si alguno de los parámetros es longdouble, entonces la variante longdouble se llama. De lo contrario, si cualquiera de los parámetros es double, entonces la variante double se llama. De lo contrario, la variante float se llama .
    Original:
    If any of the parameters is longdouble, then the longdouble variant is called. Otherwise, if any of the parameters is double, then the double variant is called. Otherwise, float variant 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.
    Original:
    The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Type-generic macro Real function
variants
 
float
double
longdouble
atan2 atan2fatan2atan2l
cbrt cbrtfcbrtcbrtl
ceil ceilfceilceill
copysign copysignfcopysigncopysignl
erf erfferferfl
erfc erfcferfcerfcl
exp2 exp2fexp2exp2l
expm1 expm1fexpm1expm1l
fdim fdimffdimfdiml
floor floorffloorfloorl
fma fmaffmafmal
fmax fmaxffmaxfmaxl
fmin fminffminfminl
fmod fmodffmodfmodl
frexp frexpffrexpfrexpl
hypot hypotfhypothypotl
ilogb ilogbfilogbilogbl
ldexp ldexpfldexpldexpl
lgamma lgammaflgammalgammal
llrint llrintfllrintllrintl
llround llroundfllroundllroundl
log10 log10flog10log10l
log1p log1pflog1plog1pl
log2 log2flog2log2l
logb logbflogblogbl
lrint lrintflrintlrintl
lround lroundflroundlroundl
nearbyint nearbyintfnearbyintnearbyintl
nextafter nextafterfnextafternextafterl
nexttoward nexttowardfnexttowardnexttowardl
remainder remainderfremainderremainderl
remquo remquofremquoremquol
rint rintfrintrintl
round roundfroundroundl
scalbln scalblnfscalblnscalblnl
scalbn scalbnfscalbnscalbnl
tgamma tgammaftgammatgammal
trunc truncftrunctruncl

[editar]Ejemplo

int i;float f;double d;longdouble ld;floatcomplex fc;doublecomplex dc;longdoublecomplex ldc;   // macro -> function callcos(i);// -> cos(i)sin(f);// -> sinf(f)acos(d);// -> acos(d)sqrt(dc);// -> csqrt(dc);


close