[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/numeric/math/math_errhandling [Back]  [Original]

MATH_ERRNO, MATH_ERREXCEPT, math_errhandling cppreference.com
cppreference.com

MATH_ERRNO, MATH_ERREXCEPT, math_errhandling

cppreference.com

<metanoindex/>

 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
(C++17)
(C++20)
(C++11)
(C++11)
(C++17)
(C++17)
(C++20)
(C++20)
(C++11)
(C++17)
(C++20)
(C++23)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
 
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)
/
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
-
(C++11)(C++11)(C++11)(C++11)(C++11)
 
<tbody> </tbody>
#define MATH_ERRNO 1
( C++11)
#define MATH_ERREXCEPT 2
( C++11)
#define math_errhandling /*implementation defined*/
( C++11)
math_errhandling int, MATH_ERRNO, MATH_ERREXCEPT OR (MATH_ERRNO | MATH_ERREXCEPT).
:
The macro constant math_errhandling expands to an expression of type int that is either equal to MATH_ERRNO, or equal to MATH_ERREXCEPT, or equal to their bitwise OR (MATH_ERRNO | MATH_ERREXCEPT).
Google.
. .
math_errhandling , ,
:
The value of math_errhandling indicates the type of error handling that is performed by the floating-point operators and functions:
Google.
. .
Constant
:
Constant
Google.
. .
Explanation
MATH_ERREXCEPT
, : FE_DIVBYZERO, FE_INVALID, FE_OVERFLOW <cfenv> .
:
indicates that floating-point exceptions are used: at least FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW are defined in <cfenv>.
Google.
. .
MATH_ERRNO
, errno .
:
indicates that floating-point operations use the variable errno to report errors.
Google.
. .


:
:
The following floating-point error conditions are recognized:
Google.
. .
# ( , , , std::sqrt(-1), std::log(-1), std::acos(2)). MATH_ERRNO , EDOM errno. MATH_ERREXCEPT , FE_INVALID .
:
# Domain error (input argument is outside the range in which the operation is mathematically defined, e.g. std::sqrt(-1), std::log(-1), or std::acos(2)). If MATH_ERRNO bit is set, EDOM is assigned to errno. If MATH_ERREXCEPT bit is set, FE_INVALID is raised.
Google.
. .
# ( , , std::atanh(-1), std::log(0.0), std::lgamma(0.0)). MATH_ERRNO , ERANGE errno. MATH_ERREXCEPT , FE_DIVBYZERO FE_OVERFLOW .
:
# Range error (the mathematical result cannot be represented as the object of specified type, e.g. std::atanh(-1), std::log(0.0), or std::lgamma(0.0)). If MATH_ERRNO bit is set, ERANGE is assigned to errno. If MATH_ERREXCEPT bit is set, FE_DIVBYZERO or FE_OVERFLOW is raised.
Google.
. .
# Overflow ( , , , , , std::exp ). MATH_ERRNO , ERANGE errno. MATH_ERREXCEPT , FE_OVERFLOW .
:
# Overflow (the mathematical result is finite, but too big to be represented without extreme roundoff error, e.g. functions such as std::exp with sufficiently large arguments). If MATH_ERRNO bit is set, ERANGE is assigned to errno. If MATH_ERREXCEPT bit is set, FE_OVERFLOW is raised.
Google.
. .
# Underflow ( , , , , , std::sin(subnormal) ). MATH_ERRNO , ERANGE errno. MATH_ERREXCEPT , FE_UNDERFLOW .
:
# Underflow (the mathematical result is non-zero, but too small to be represented without extreme roundoff error, e.g. the result is subnormal, as in std::sin(subnormal) or for many other functions with subnormal arguments). If MATH_ERRNO bit is set, ERANGE may be assigned to errno. If MATH_ERREXCEPT bit is set, FE_UNDERFLOW may be raised.
Google.
. .

.


() []
, , POSIX
(macro variable) []

Web Proxy Viewer  |  New URL  |  Original Page