Main namespace for half-precision functionality.
This namespace contains all the functionality provided by the library.
Namespaces | |
| detail | |
Data Structures | |
| class | half |
| Half-precision floating-point type. More... | |
|
inline |
Absolute value.
See also: Documentation for std::abs.
| arg | operand |
Definition at line 2752 of file includes/half.hpp.
References fabs().
Referenced by acos(), acosh(), half_float::detail::angle_arg(), half_float::detail::area(), asin(), asinh(), atan(), half_float::detail::atan2_args(), atanh(), cbrt(), cos(), cosh(), half_float::detail::erf(), erf(), erfc(), exp(), exp2(), expm1(), half_float::detail::f31::f31(), half_float::detail::float2half_impl(), frexp(), half_float::detail::gamma(), half_float::detail::half2float_impl(), half_float::detail::half2int(), half_float::detail::hyperbolic_args(), ilogb(), half_float::detail::integral(), lgamma(), log(), log10(), log1p(), log2(), logb(), modf(), rsqrt(), scalbln(), sin(), sincos(), sinh(), sqrt(), tan(), tanh(), and tgamma().
Arc cosine function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::acos.
| arg | function argument |
| FE_INVALID | for signaling NaN or if abs(arg) > 1 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3700 of file includes/half.hpp.
References abs(), half_float::detail::atan2(), half_float::detail::atan2_args(), half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
Hyperbolic area cosine.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::acosh.
| arg | function argument |
| FE_INVALID | for signaling NaN or arguments <1 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3925 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
Arc sine.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::asin.
| arg | function argument |
| FE_INVALID | for signaling NaN or if abs(arg) > 1 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3671 of file includes/half.hpp.
References abs(), half_float::detail::atan2(), half_float::detail::atan2_args(), half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
Hyperbolic area sine.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::asinh.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3897 of file includes/half.hpp.
References abs(), half_float::detail::binary, and half_float::detail::signal().
Arc tangent function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::atan.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3725 of file includes/half.hpp.
References abs(), half_float::detail::atan2(), half_float::detail::binary, exp(), and half_float::detail::signal().
Referenced by TrackerVizOutput::drawUncertaintyEllipse(), rs2_deproject_pixel_to_point(), and rs2_project_point_to_pixel().
Arc tangent function.
This function may be 1 ULP off the correctly rounded exact result in ~0.005% of inputs for std::round_to_nearest, in ~0.1% of inputs for std::round_toward_zero and in ~0.02% of inputs for any other rounding mode.
See also: Documentation for std::atan2.
| y | numerator |
| x | denominator |
| FE_INVALID | if x or y is signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3755 of file includes/half.hpp.
References half_float::detail::atan2(), half_float::detail::binary, and half_float::detail::signal().
Hyperbolic area tangent.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::atanh.
| arg | function argument |
| FE_INVALID | for signaling NaN or if abs(arg) > 1 |
| FE_DIVBYZERO | for +/-1 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3950 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::divide64(), exp(), half_float::detail::invalid(), half_float::detail::log2(), half_float::detail::pole(), and half_float::detail::signal().
Cubic root.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::cbrt.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | according to rounding |
Definition at line 3281 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::divide64(), exp(), half_float::detail::exp2(), half_float::detail::multiply64(), half_float::detail::sign_mask(), and half_float::detail::signal().
Nearest integer not less than half value.
See also: Documentation for std::ceil.
| arg | half to round |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | if value had to be rounded |
Definition at line 4088 of file includes/half.hpp.
References half_float::detail::binary.
|
inline |
Take sign.
See also: Documentation for std::copysign.
| x | value to change sign for |
| y | value to take sign from |
Definition at line 4359 of file includes/half.hpp.
References half_float::detail::binary.
Cosine function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::cos.
| arg | function argument |
| FE_INVALID | for signaling NaN or infinity |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3606 of file includes/half.hpp.
References abs(), half_float::detail::angle_arg(), half_float::detail::binary, half_float::detail::invalid(), half_float::detail::signal(), and half_float::detail::sincos().
Referenced by TrackerVizOutput::drawUncertaintyEllipse(), CV_FUNCS::getHanningWindow(), and sincos().
Hyperbolic cosine.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::cosh.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3838 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::hyperbolic_args(), and half_float::detail::signal().
Error function.
This function may be 1 ULP off the correctly rounded exact result for any rounding mode in <0.5% of inputs.
See also: Documentation for std::erf.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3983 of file includes/half.hpp.
References abs(), half_float::detail::binary, and half_float::detail::signal().
Complementary error function.
This function may be 1 ULP off the correctly rounded exact result for any rounding mode in <0.5% of inputs.
See also: Documentation for std::erfc.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4005 of file includes/half.hpp.
References abs(), half_float::detail::binary, and half_float::detail::signal().
Exponential function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::exp.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2953 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::multiply64(), and half_float::detail::signal().
Referenced by half_float::detail::angle_arg(), atan(), half_float::detail::atan2_args(), atanh(), cbrt(), cosh(), exp2(), half_float::detail::exp2_post(), expm1(), half_float::detail::fixed2half(), half_float::detail::float2half_impl(), fma(), frexp(), CV_FUNCS::get2dGaussianPdf(), half_float::detail::half2int(), half_float::detail::hyperbolic_args(), half_float::detail::hypot_post(), ilogb(), half_float::detail::int2half(), half_float::detail::integral(), ldexp(), log(), log10(), log1p(), log2(), half_float::detail::log2_post(), logb(), half_float::detail::mod(), modf(), operator*(), operator+(), operator/(), pow(), scalbln(), scalbn(), sinh(), half_float::detail::sqrt(), sqrt(), tan(), half_float::detail::tangent_post(), and tanh().
Binary exponential.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::exp2.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2988 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), and half_float::detail::signal().
Exponential minus one.
This function may be 1 ULP off the correctly rounded exact result in <0.05% of inputs for std::round_to_nearest and in <1% of inputs for any other rounding mode.
See also: Documentation for std::expm1.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3014 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::divide64(), exp(), half_float::detail::exp2(), half_float::detail::multiply64(), and half_float::detail::signal().
|
inline |
Absolute value.
See also: Documentation for std::fabs.
| arg | operand |
Definition at line 2746 of file includes/half.hpp.
References half_float::detail::binary.
Referenced by abs(), nextafter(), and nexttoward().
Positive difference.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::fdim.
| x | first operand |
| y | second operand |
| FE_... | according to operator-(half,half) |
Definition at line 2921 of file includes/half.hpp.
References half_float::detail::binary, isnan(), and half_float::detail::signal().
|
inline |
Clear exception flags.
This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
See also: Documentation for std::feclearexcept.
| excepts | OR of exceptions to clear |
| 0 | all selected flags cleared successfully |
Definition at line 4535 of file includes/half.hpp.
References half_float::detail::errflags().
|
inline |
Save exception flags.
This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
See also: Documentation for std::fegetexceptflag.
| flagp | adress to store flag state at |
| excepts | OR of flags to save |
| 0 | for success |
Definition at line 4565 of file includes/half.hpp.
References half_float::detail::errflags().
|
inline |
Raise exception flags.
This raises the specified floating point exceptions and also invokes any additional automatic exception handling as configured with the HALF_ERRHANDLIG_... preprocessor symbols. This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
See also: Documentation for std::feraiseexcept.
| excepts | OR of exceptions to raise |
| 0 | all selected exceptions raised successfully |
Definition at line 4555 of file includes/half.hpp.
References half_float::detail::errflags(), and half_float::detail::raise().
Referenced by half_float::detail::raise().
|
inline |
Restore exception flags.
This only copies the specified exception state (including unset flags) without incurring any additional exception handling. This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
See also: Documentation for std::fesetexceptflag.
| flagp | adress to take flag state from |
| excepts | OR of flags to restore |
| 0 | for success |
Definition at line 4576 of file includes/half.hpp.
References half_float::detail::errflags().
|
inline |
Test exception flags.
This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
See also: Documentation for std::fetestexcept.
| excepts | OR of exceptions to test |
Definition at line 4544 of file includes/half.hpp.
References half_float::detail::errflags().
|
inline |
Throw C++ exceptions based on set exception flags.
This function manually throws a corresponding C++ exception if one of the specified flags is set, no matter if automatic throwing (via HALF_ERRHANDLING_THROW_...) is enabled or not. This function works even if automatic exception flag handling is disabled, but in that case manual flag management is the only way to raise flags.
| excepts | OR of exceptions to test |
| msg | error message to use for exception description |
| std::domain_error | if FE_INVALID or FE_DIVBYZERO is selected and set |
| std::overflow_error | if FE_OVERFLOW is selected and set |
| std::underflow_error | if FE_UNDERFLOW is selected and set |
| std::range_error | if FE_INEXACT is selected and set |
Definition at line 4589 of file includes/half.hpp.
References half_float::detail::errflags(), FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, and FE_UNDERFLOW.
Nearest integer not greater than half value.
See also: Documentation for std::floor.
| arg | half to round |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | if value had to be rounded |
Definition at line 4096 of file includes/half.hpp.
References half_float::detail::binary.
Fused multiply add.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::fma.
| x | first operand |
| y | second operand |
| z | third operand |
| FE_INVALID | according to operator*() and operator+() unless any argument is a quiet NaN and no argument is a signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding the final addition |
Definition at line 2826 of file includes/half.hpp.
References half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::signal(), and absl::swap_internal::swap().
|
inline |
Maximum of half expressions.
See also: Documentation for std::fmax.
| x | first operand |
| y | second operand |
| FE_INVALID | if x or y is signaling NaN |
Definition at line 2895 of file includes/half.hpp.
References half_float::detail::binary, isnan(), and half_float::detail::select().
|
inline |
Minimum of half expressions.
See also: Documentation for std::fmin.
| x | first operand |
| y | second operand |
| FE_INVALID | if x or y is signaling NaN |
Definition at line 2907 of file includes/half.hpp.
References half_float::detail::binary, isnan(), and half_float::detail::select().
Remainder of division.
See also: Documentation for std::fmod.
| x | first operand |
| y | second operand |
| FE_INVALID | if x is infinite or y is 0 or if x or y is signaling NaN |
Definition at line 2760 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
|
inline |
Classify floating-point value.
See also: Documentation for std::fpclassify.
| arg | number to classify |
| FP_ZERO | for positive and negative zero |
| FP_SUBNORMAL | for subnormal numbers |
| FP_INFINITY | for positive and negative infinity |
| FP_NAN | for NaNs |
| FP_NORMAL | for all other (normal) values |
Definition at line 4374 of file includes/half.hpp.
References FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, and FP_ZERO.
Decompress floating-point number.
See also: Documentation for std::frexp.
| arg | number to decompress |
| exp | address to store exponent at |
| FE_INVALID | for signaling NaN |
Definition at line 4171 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), and half_float::detail::signal().
Referenced by half_float::detail::float2half_impl().
| T half_float::half_cast | ( | U | arg | ) |
Cast to or from half-precision floating-point number.
This casts between half and any built-in arithmetic type. The values are converted directly using the default rounding mode, without any roundtrip over float that a static_cast would otherwise do.
Using this cast with neither of the two types being a half or with any of the two types not being a built-in arithmetic type (apart from half, of course) results in a compiler error and casting between halfs returns the argument unmodified.
| T | destination type (half or built-in arithmetic type) |
| U | source type (half or built-in arithmetic type) |
| arg | value to cast |
| FE_INVALID | if T is integer type and result is not representable as T |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4504 of file includes/half.hpp.
| T half_float::half_cast | ( | U | arg | ) |
Cast to or from half-precision floating-point number.
This casts between half and any built-in arithmetic type. The values are converted directly using the specified rounding mode, without any roundtrip over float that a static_cast would otherwise do.
Using this cast with neither of the two types being a half or with any of the two types not being a built-in arithmetic type (apart from half, of course) results in a compiler error and casting between halfs returns the argument unmodified.
| T | destination type (half or built-in arithmetic type) |
| R | rounding mode to use. |
| U | source type (half or built-in arithmetic type) |
| arg | value to cast |
| FE_INVALID | if T is integer type and result is not representable as T |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4520 of file includes/half.hpp.
Hypotenuse function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::hypot.
| x | first argument |
| y | second argument |
| FE_INVALID | if x or y is signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding of the final square root |
Definition at line 3332 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::check_underflow(), hypot(), half_float::detail::select(), half_float::detail::signal(), sqrt(), and absl::swap_internal::swap().
Referenced by hypot().
Hypotenuse function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::hypot.
| x | first argument |
| y | second argument |
| z | third argument |
| FE_INVALID | if x, y or z is signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding of the final square root |
Definition at line 3378 of file includes/half.hpp.
References half_float::detail::binary, hypot(), half_float::detail::select(), half_float::detail::signal(), sqrt(), and absl::swap_internal::swap().
Referenced by hypot().
|
inline |
Extract exponent.
See also: Documentation for std::ilogb.
| arg | number to query |
| FP_ILOGB0 | for zero |
| FP_ILOGBNAN | for NaN |
| INT_MAX | for infinity |
| FE_INVALID | for 0 or infinite values |
Definition at line 4264 of file includes/half.hpp.
References abs(), exp(), FE_INVALID, FP_ILOGB0, FP_ILOGBNAN, and half_float::detail::raise().
|
inline |
Check if finite number.
See also: Documentation for std::isfinite.
| arg | number to check |
| true | if neither infinity nor NaN |
| false | else |
Definition at line 4388 of file includes/half.hpp.
|
inline |
Quiet comparison for greater than.
See also: Documentation for std::isgreater.
| x | first operand |
| y | second operand |
| true | if x greater than y |
| false | else |
Definition at line 4429 of file includes/half.hpp.
References isnan().
|
inline |
Quiet comparison for greater equal.
See also: Documentation for std::isgreaterequal.
| x | first operand |
| y | second operand |
| true | if x greater equal y |
| false | else |
Definition at line 4440 of file includes/half.hpp.
References isnan().
|
inline |
Check for infinity.
See also: Documentation for std::isinf.
| arg | number to check |
| true | for positive or negative infinity |
| false | else |
Definition at line 4395 of file includes/half.hpp.
Referenced by half_float::detail::builtin_isinf().
|
inline |
Quiet comparison for less than.
See also: Documentation for std::isless.
| x | first operand |
| y | second operand |
| true | if x less than y |
| false | else |
Definition at line 4451 of file includes/half.hpp.
References isnan().
|
inline |
Quiet comparison for less equal.
See also: Documentation for std::islessequal.
| x | first operand |
| y | second operand |
| true | if x less equal y |
| false | else |
Definition at line 4462 of file includes/half.hpp.
References isnan().
|
inline |
Quiet comarison for less or greater.
See also: Documentation for std::islessgreater.
| x | first operand |
| y | second operand |
| true | if either less or greater |
| false | else |
Definition at line 4473 of file includes/half.hpp.
References isnan().
|
inline |
Check for NaN.
See also: Documentation for std::isnan.
| arg | number to check |
| true | for NaNs |
| false | else |
Definition at line 4402 of file includes/half.hpp.
Referenced by half_float::detail::builtin_isnan(), fdim(), fmax(), fmin(), isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), and isunordered().
|
inline |
Check if normal number.
See also: Documentation for std::isnormal.
| arg | number to check |
| true | if normal number |
| false | if either subnormal, zero, infinity or NaN |
Definition at line 4409 of file includes/half.hpp.
|
inline |
Quiet check if unordered.
See also: Documentation for std::isunordered.
| x | first operand |
| y | second operand |
| true | if unordered (one or two NaN operands) |
| false | else |
Definition at line 4484 of file includes/half.hpp.
References isnan().
Multiply by power of two.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::ldexp.
| arg | number to modify |
| exp | power of two to multiply with |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4228 of file includes/half.hpp.
References exp(), and scalbln().
Referenced by half_float::detail::float2half_impl(), and half_float::detail::half2float_impl().
Natural logarithm of gamma function.
This function may be 1 ULP off the correctly rounded exact result for any rounding mode in ~0.025% of inputs.
See also: Documentation for std::lgamma.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_DIVBYZERO | for 0 or negative integer arguments |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4030 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::pole(), and half_float::detail::signal().
Natural logarithm.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::log.
| arg | function argument |
| FE_INVALID | for signaling NaN or negative argument |
| FE_DIVBYZERO | for 0 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3067 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::log2(), half_float::detail::pole(), and half_float::detail::signal().
Common logarithm.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::log10.
| arg | function argument |
| FE_INVALID | for signaling NaN or negative argument |
| FE_DIVBYZERO | for 0 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3095 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::log2(), half_float::detail::pole(), and half_float::detail::signal().
Natural logarithm plus one.
This function may be 1 ULP off the correctly rounded exact result in <0.05% of inputs for std::round_to_nearest and in ~1% of inputs for any other rounding mode.
See also: Documentation for std::log1p.
| arg | function argument |
| FE_INVALID | for signaling NaN or argument <-1 |
| FE_DIVBYZERO | for -1 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3173 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::log2(), half_float::detail::pole(), and half_float::detail::signal().
Binary logarithm.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::log2.
| arg | function argument |
| FE_INVALID | for signaling NaN or negative argument |
| FE_DIVBYZERO | for 0 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3130 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::pole(), half_float::detail::sign_mask(), and half_float::detail::signal().
Extract exponent.
See also: Documentation for std::logb.
| arg | number to query |
| FE_INVALID | for signaling NaN |
| FE_DIVBYZERO | for 0 |
Definition at line 4282 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::pole(), and half_float::detail::signal().
|
inline |
Nearest integer using half's internal rounding mode.
See also: Documentation for std::lrint.
| arg | half expression to round |
| FE_INVALID | if value is not representable as long |
| FE_INEXACT | if value had to be rounded |
Definition at line 4135 of file includes/half.hpp.
|
inline |
Nearest integer.
See also: Documentation for std::lround.
| arg | half to round |
| FE_INVALID | if value is not representable as long |
Definition at line 4119 of file includes/half.hpp.
Extract integer and fractional parts.
See also: Documentation for std::modf.
| arg | number to decompress |
| iptr | address to store integer part at |
| FE_INVALID | for signaling NaN |
Definition at line 4236 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), and half_float::detail::signal().
Referenced by half_float::detail::float2half_impl().
|
inline |
Get NaN value.
See also: Documentation for std::nan.
| arg | string code |
Definition at line 2932 of file includes/half.hpp.
References half_float::detail::binary.
Nearest integer using half's internal rounding mode.
See also: Documentation for std::nearbyint.
| arg | half expression to round |
| FE_INVALID | for signaling NaN |
Definition at line 4142 of file includes/half.hpp.
References half_float::detail::binary.
Next representable value.
See also: Documentation for std::nextafter.
| from | value to compute next representable value for |
| to | direction towards which to compute next value |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW | for infinite result from finite argument |
| FE_UNDERFLOW | for subnormal result |
Definition at line 4308 of file includes/half.hpp.
References half_float::detail::binary, fabs(), FE_OVERFLOW, FE_UNDERFLOW, HALF_ERRHANDLING_UNDERFLOW_TO_INEXACT, half_float::detail::raise(), and half_float::detail::signal().
Next representable value.
See also: Documentation for std::nexttoward.
| from | value to compute next representable value for |
| to | direction towards which to compute next value |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW | for infinite result from finite argument |
| FE_UNDERFLOW | for subnormal result |
Definition at line 4335 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::builtin_isnan(), half_float::detail::builtin_signbit(), fabs(), FE_OVERFLOW, FE_UNDERFLOW, HALF_ERRHANDLING_UNDERFLOW_TO_INEXACT, half_float::detail::raise(), and half_float::detail::signal().
|
inline |
Comparison for inequality.
| x | first operand |
| y | second operand |
| true | if operands not equal |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2494 of file includes/half.hpp.
References half_float::detail::compsignal().
Multiplication.
This operation is exact to rounding for all rounding modes.
| x | left operand |
| y | right operand |
| FE_INVALID | if multiplying 0 with infinity or if x or y is signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2635 of file includes/half.hpp.
References half_float::detail::binary, exp(), half_float::detail::invalid(), and half_float::detail::signal().
|
inline |
Identity.
| arg | operand |
Definition at line 2555 of file includes/half.hpp.
Addition.
This operation is exact to rounding for all rounding modes.
| x | left operand |
| y | right operand |
| FE_INVALID | if x and y are infinities with different signs or signaling NaNs |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2569 of file includes/half.hpp.
References half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::signal(), and absl::swap_internal::swap().
|
inline |
Negation.
| arg | operand |
Definition at line 2560 of file includes/half.hpp.
References half_float::detail::binary.
Subtraction.
This operation is exact to rounding for all rounding modes.
| x | left operand |
| y | right operand |
| FE_INVALID | if x and y are infinities with equal signs or signaling NaNs |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2619 of file includes/half.hpp.
References half_float::detail::binary.
Division.
This operation is exact to rounding for all rounding modes.
| x | left operand |
| y | right operand |
| FE_INVALID | if dividing 0s or infinities with each other or if x or y is signaling NaN |
| FE_DIVBYZERO | if dividing finite value by 0 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2668 of file includes/half.hpp.
References half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::pole(), and half_float::detail::signal().
|
inline |
Comparison for less than.
| x | first operand |
| y | second operand |
| true | if x less than y |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2505 of file includes/half.hpp.
References half_float::detail::compsignal().
| std::basic_ostream< charT, traits > & half_float::operator<< | ( | std::basic_ostream< charT, traits > & | out, |
| half | arg | ||
| ) |
Output operator.
This uses the built-in functionality for streaming out floating-point numbers.
| out | output stream to write into |
| arg | half expression to write |
Definition at line 2707 of file includes/half.hpp.
|
inline |
Comparison for less equal.
| x | first operand |
| y | second operand |
| true | if x less equal y |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2529 of file includes/half.hpp.
References half_float::detail::compsignal().
|
inline |
Comparison for equality.
| x | first operand |
| y | second operand |
| true | if operands equal |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2483 of file includes/half.hpp.
References half_float::detail::compsignal().
|
inline |
Comparison for greater than.
| x | first operand |
| y | second operand |
| true | if x greater than y |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2517 of file includes/half.hpp.
References half_float::detail::compsignal().
|
inline |
Comparison for greater equal.
| x | first operand |
| y | second operand |
| true | if x greater equal y |
| false | else |
| FE_INVALID | if x or y is NaN |
Definition at line 2541 of file includes/half.hpp.
References half_float::detail::compsignal().
| std::basic_istream< charT, traits > & half_float::operator>> | ( | std::basic_istream< charT, traits > & | in, |
| half & | arg | ||
| ) |
Input operator.
This uses the built-in functionality for streaming in floating-point numbers, specifically double precision floating point numbers (unless overridden with HALF_ARITHMETIC_TYPE). So the input string is first rounded to double precision using the underlying platform's current floating-point rounding mode before being rounded to half-precision using the library's half-precision rounding mode.
| in | input stream to read from |
| arg | half to read into |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2725 of file includes/half.hpp.
Power function.
This function may be 1 ULP off the correctly rounded exact result for any rounding mode in ~0.00025% of inputs.
See also: Documentation for std::pow.
| x | base |
| y | exponent |
| FE_INVALID | if x or y is signaling NaN or if x is finite an negative and y is finite and not integral |
| FE_DIVBYZERO | if x is 0 and y is negative |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3444 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::check_underflow(), exp(), half_float::detail::invalid(), half_float::detail::multiply64(), half_float::detail::pole(), half_float::detail::select(), half_float::detail::sign_mask(), half_float::detail::signal(), and sqrt().
Referenced by TrackerVizOutput::drawUncertaintyEllipse(), CV_FUNCS::get2dGaussianPdf(), rs2_project_color_pixel_to_depth_pixel(), and rsqrt().
Remainder of division.
See also: Documentation for std::remainder.
| x | first operand |
| y | second operand |
| FE_INVALID | if x is infinite or y is 0 or if x or y is signaling NaN |
Definition at line 2781 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
Remainder of division.
See also: Documentation for std::remquo.
| x | first operand |
| y | second operand |
| quo | address to store some bits of quotient at |
| FE_INVALID | if x is infinite or y is 0 or if x or y is signaling NaN |
Definition at line 2801 of file includes/half.hpp.
References half_float::detail::binary, half_float::detail::invalid(), and half_float::detail::signal().
Nearest integer using half's internal rounding mode.
See also: Documentation for std::rint.
| arg | half expression to round |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | if value had to be rounded |
Definition at line 4127 of file includes/half.hpp.
References half_float::detail::binary.
Nearest integer.
See also: Documentation for std::round.
| arg | half to round |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | if value had to be rounded |
Definition at line 4112 of file includes/half.hpp.
References half_float::detail::binary.
Inverse square root.
This function is exact to rounding for all rounding modes and thus generally more accurate than directly computing 1 / sqrt(arg) in half-precision, in addition to also being faster.
| arg | function argument |
| FE_INVALID | for signaling NaN and negative arguments |
| FE_INEXACT | according to rounding |
Definition at line 3244 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::invalid(), half_float::detail::pole(), pow(), half_float::detail::signal(), and sqrt().
Multiply by power of two.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::scalbln.
| arg | number to modify |
| exp | power of two to multiply with |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4191 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), and half_float::detail::signal().
Multiply by power of two.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::scalbn.
| arg | number to modify |
| exp | power of two to multiply with |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4217 of file includes/half.hpp.
|
inline |
Check sign.
See also: Documentation for std::signbit.
| arg | number to check |
| true | for negative number |
| false | for positive number |
Definition at line 4416 of file includes/half.hpp.
Referenced by half_float::detail::builtin_signbit().
Sine function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::sin.
| arg | function argument |
| FE_INVALID | for signaling NaN or infinity |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3573 of file includes/half.hpp.
References abs(), half_float::detail::angle_arg(), half_float::detail::binary, half_float::detail::invalid(), half_float::detail::signal(), and half_float::detail::sincos().
Referenced by TrackerVizOutput::drawUncertaintyEllipse(), and sincos().
Compute sine and cosine simultaneously.
This returns the same results as sin() and cos() but is faster than calling each function individually.
This function is exact to rounding for all rounding modes.
| arg | function argument |
| sin | variable to take sine of arg |
| cos | variable to take cosine of arg |
| FE_INVALID | for signaling NaN or infinity |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3508 of file includes/half.hpp.
References abs(), half_float::detail::angle_arg(), half_float::detail::binary, cos(), half_float::detail::invalid(), half_float::detail::signal(), sin(), and half_float::detail::sincos().
Hyperbolic sine.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::sinh.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3810 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::hyperbolic_args(), and half_float::detail::signal().
Square root.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::sqrt.
| arg | function argument |
| FE_INVALID | for signaling NaN and negative arguments |
| FE_INEXACT | according to rounding |
Definition at line 3223 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::invalid(), and half_float::detail::signal().
Tangent function.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::tan.
| arg | function argument |
| FE_INVALID | for signaling NaN or infinity |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3634 of file includes/half.hpp.
References abs(), half_float::detail::angle_arg(), half_float::detail::binary, exp(), half_float::detail::invalid(), half_float::detail::sign_mask(), half_float::detail::signal(), and half_float::detail::sincos().
Referenced by rs2_deproject_pixel_to_point(), and rs2_project_point_to_pixel().
Hyperbolic tangent.
This function is exact to rounding for all rounding modes.
See also: Documentation for std::tanh.
| arg | function argument |
| FE_INVALID | for signaling NaN |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 3865 of file includes/half.hpp.
References abs(), half_float::detail::binary, exp(), half_float::detail::hyperbolic_args(), and half_float::detail::signal().
Gamma function.
This function may be 1 ULP off the correctly rounded exact result for any rounding mode in <0.25% of inputs.
See also: Documentation for std::tgamma.
| arg | function argument |
| FE_INVALID | for signaling NaN, negative infinity or negative integer arguments |
| FE_DIVBYZERO | for 0 |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 4055 of file includes/half.hpp.
References abs(), half_float::detail::binary, half_float::detail::invalid(), half_float::detail::pole(), and half_float::detail::signal().
Nearest integer not greater in magnitude than half value.
See also: Documentation for std::trunc.
| arg | half to round |
| FE_INVALID | for signaling NaN |
| FE_INEXACT | if value had to be rounded |
Definition at line 4104 of file includes/half.hpp.
References half_float::detail::binary.