📄 fabs.c
字号:
/* * lib-src/ansi/math/fabs.c * ANSI/ISO 9899-1990, Section 7.5.6.2. * * double fabs(double x) * Return the absolute value of x. * * Exceptions: * EDOM NaN x is NaN * none +Infinity x is [+-]Infinity */#include "mathlib.h"#if defined(__TCS__)#include <ops/custom_ops.h>#endif /* defined(__TCS__) */doublefabs(double x){#if defined(__TCS__) return fabsval((float)x);#else /* defined(__TCS__) */#if defined(__IEEE_FP__) if (_isNaN(x)) { errno = EDOM; return x; /* NaN: domain error, return NaN */ } else if (_isInfinity(x)) return _pInfinity; /* [+-]Infinity: no error, return +Infinity */#endif /* defined(__IEEE_FP__) */ return (x < 0.0) ? -x : x;#endif /* defined(__TCS__) */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -