| C++ Builder 串口控件 | | C++ Builder 编程技巧 | | C++ Builder 操作指南 | | C++ Builder 参考手册 | | 基础知识 | | cfloat 浮点数 | | cmath 数学函数 | | • acos, acosf, acosl | | • acosh, acoshf, acoshl | | • asin, asinf, asinl | | • asinh, asinhf, asinhl | | • atan, atanf, atanl | | • atan2, atan2f, atan2l | | • atanh, atanhf, atanhl | | • ceil, ceilf, ceill | | • copysign, copysignf, copysignl | | • cos, cosf, cosl | | • cosh, coshf, coshl | | • exp, expf, expl | | • exp2, exp2f, exp2l | | • expm1, expm1f, expm1l | | • fabs, fabsf, fabsl | | • floor, floorf, floorl | | • fmod, fmodf, fmodl | | • frexp, frexpf, frexpl | | • hypot, hypotf, hypotl | | • ldexp, ldexpf, ldexpl | | • log, logf, logl | | • log10, log10f, log10l | | • log1p, log1pf, log1pl | | • log2, log2f, log2l | | • modf, modff, modfl | | • nan, nanf, nanl | | • poly, polyl | | • pow, powf, powl | | • pow10, pow10l | | • round, roundf, roundl | | • sin, sinf, sinl | | • sinh, sinhf, sinhl | | • sqrt, sqrtf, sqrtl | | • tan, tanf, tanl | | • tanh, tanhf, tanhl | | • trunc, truncf, truncl | | • _exception, _exceptionl | | • _matherr, _matherrl | | • HUGE_VAL, HUGE_VALF, HUGE_VALL, _LHUGE_VAL | | • EDOM, ERANGE | | • _mexcep, DOMAIN, SING, OVERFLOW, UNDERFLOW, TLOSS, PLOSS, STACKFAULT | | • M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10 | | • M_PI, M_PI_2, M_PI_4, M_1_PI, M_2_PI, M_1_SQRTPI, M_2_SQRTPI | | • M_SQRT2, M_SQRT_2 | | • DOMAIN error 定义域错误 | | cstdlib 标准库函数 | | System 字符串 | | System 日期和时间 | | System.Math.hpp 数学函数 | | 其他数据类型 | | VCL 基础类 | | VCL 应用程序 | | Pictures 图片 | | Graphics 绘图 | | Additional 控件 | | System 控件 | | A ~ Z 字母顺序排列的目录 | | 网友留言/技术支持 |
|
| _exception, _exceptionl - cmath 数学函数的异常,_matherr 和 _matherrl 的参数类型 |
结构体定义:
| 结构体定义 |
Turbo C/C++
Borland C++ |
Visual C++ |
C90 |
C99 |
C++98 |
C++11 |
struct _exception
{
int type;
char _FAR *name;
double arg1, arg2, retval;
}; |
√ |
√ |
|
|
|
|
struct _exceptionl
{
int type;
char _FAR *name;
long double arg1, arg2, retval;
}; |
√ |
√ |
|
|
|
|
头文件:
#include <cmath>
命名空间:
无。由于为了兼容 C 语言的捕获异常方式,_exception 和 _exceptionl 结构体,与 _matherr 和 _matherrl 函数都不在命名空间里面
成员:
| 成员 |
类型 |
描述 |
| type |
int |
异常类型 _mexcep,产生异常的原因,请参考 _mexcep 类型。 |
| name |
char _FAR * |
产生异常的函数名,例如 "log"、"pow"、"sqrt" 等 |
| arg1 |
double / long double |
函数的第一个参数值 |
| arg2 |
double / long double |
函数的第二个参数值 (如果函数有两个参数) |
| retval |
double / long double |
函数的返回值 |
兼容性:
_exception 和 _exceptionl 结构体,与 _matherr 和 _matherrl 函数不是标准 C/C++ 的内容。
C++ Builder 和 Visual C++ 都是用这个方法捕获的 cmath / math.h 函数异常,并且兼容早期版本的 Turbo C/C++ 和 Borland C++。
在 MSDN 里面可以找到这些内容在 Visual C++ 里面应用的描述。
| 函数 \ C++ Builder 编译器 |
bcc32 |
clang32 |
clang64 |
| _exception |
√ |
√ |
√ |
| _exceptionl |
√ |
√ |
√ |
相关链接:
• _matherr • _mexcep • DOMAIN error 定义域错误 • 浮点数异常处理
|
|
|
|