Type-generic math
Материал из cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
В заголовке
<tgmath.h> включает в себя заголовки <math.h> и <complex.h> и определяет несколько типов общих макросов. Эти макросы определяет фактическую функцию для вызова в зависимости от типов параметров.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.
[править] Тригонометрические, гиперболические, власти и показательной функции NJ
Тип общих макро-
XXX вызывает либо из: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.
You can help to correct and verify the translation. Click here for instructions.
- реальные функции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 вариант
XXXfOriginal:float variantXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - double вариант
XXXOriginal:double variantXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - long double вариант
XXXlOriginal:long double variantXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
- комплексная функция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 вариант
cXXXfOriginal:float variantcXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - double вариант
cXXXOriginal:double variantcXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - long double вариант
cXXXlOriginal:long double variantcXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
-
Исключение из вышеуказанного правила является
exp (см. таблицу ниже).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.
Функция для вызова определяется следующим образом:
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.
- Если какой-либо из параметров является сложной, то сложная функция называется, в противном случае реальная функция называется.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. - Если какой-либо из параметров long double, то long double вариант называется. В противном случае, если какой-либо из параметров double, то double вариант называется. В противном случае, float вариант называется.Original:If any of the parameters is long double, then the long double 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. - Поведение не определено любой из параметров является несовместимым с соответствующим аргументом функции.
Этот раздел не завершён
Причина: what's meant by incompatible?Original:The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.Этот раздел не завершён
Причина: 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.
Тип общие макросы являются следующие:
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 |
[править] Разное NJ функций
Тип общих макро-
XXX вызывает либо из вариантов реальных функций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.
- float вариант
XXXfOriginal:float variantXXXfThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - double вариант
XXXOriginal:double variantXXXThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - long double вариант
XXXlOriginal:long double variantXXXlThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Обратите внимание, нет
modf типа общих макро.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.
Функция для вызова определяется следующим образом:
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.
- Если какой-либо из параметров long double, то long double вариант называется. В противном случае, если какой-либо из параметров double, то double вариант называется. В противном случае, float вариант называется.Original:If any of the parameters is long double, then the long double 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. - Поведение не определено любой из параметров является несовместимым с соответствующим аргументом функции.
Этот раздел не завершён
Причина: what's meant by incompatible?Original:The behavior is undefined is any of the parameters is incompatible with the corresponding argument of the function.Этот раздел не завершён
Причина: 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.