|
sparrow 1.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
|
Half-precision floating-point type. More...
#include <float16_t.hpp>
Public Member Functions | |
| detail::uint16 | get_data () const |
Construction and assignment | |
| constexpr | half () noexcept |
| Default constructor. | |
| template<detail::arithmetic T> | |
| half (T rhs) | |
| Conversion constructor. | |
| operator float () const | |
| Conversion to single-precision. | |
| half & | operator= (const float &rhs) |
| Assignment operator. | |
| template<detail::arithmetic T> | |
| half & | operator= (const T &rhs) |
Arithmetic updates | |
| half & | operator+= (half rhs) |
| Arithmetic assignment. | |
| half & | operator-= (half rhs) |
| Arithmetic assignment. | |
| half & | operator*= (half rhs) |
| Arithmetic assignment. | |
| half & | operator/= (half rhs) |
| Arithmetic assignment. | |
Increment and decrement | |
| half & | operator++ () |
| Prefix increment. | |
| half & | operator-- () |
| Prefix decrement. | |
| half | operator++ (int) |
| Postfix increment. | |
| half | operator-- (int) |
| Postfix decrement. | |
Friends | |
| template<class, class, std::float_round_style> | |
| struct | detail::half_caster |
| class | std::numeric_limits< half > |
| struct | std::hash< half > |
| constexpr_NOERR bool | operator== (half x, half y) |
| Comparison for equality. | |
| template<detail::arithmetic T> | |
| constexpr_NOERR bool | operator== (half x, T y) |
| constexpr_NOERR std::partial_ordering | operator<=> (half x, half y) |
| template<detail::arithmetic T> | |
| constexpr_NOERR std::partial_ordering | operator<=> (half x, T y) |
| constexpr half | operator+ (half arg) |
| Identity. | |
| constexpr half | operator- (half arg) |
| Negation. | |
| half | operator+ (half x, half y) |
| Addition. | |
| template<class T> | |
| half | operator+ (half x, T y) |
| template<class T> | |
| half | operator+ (T x, half y) |
| half | operator- (half x, half y) |
| Subtraction. | |
| template<class T> | |
| half | operator- (half x, T y) |
| template<class T> | |
| half | operator- (T x, half y) |
| half | operator* (half x, half y) |
| Multiplication. | |
| template<class T> | |
| half | operator* (half x, T y) |
| template<class T> | |
| half | operator* (T x, half y) |
| half | operator/ (half x, half y) |
| Division. | |
| template<class T> | |
| half | operator/ (half x, T y) |
| template<class T> | |
| half | operator/ (T x, half y) |
| template<class charT, class traits> | |
| std::basic_ostream< charT, traits > & | operator<< (std::basic_ostream< charT, traits > &out, half arg) |
| Output operator. | |
| template<class charT, class traits> | |
| std::basic_istream< charT, traits > & | operator>> (std::basic_istream< charT, traits > &in, half &arg) |
| Input operator. | |
| constexpr half | fabs (half arg) |
| Absolute value. | |
| half | fmod (half x, half y) |
| Remainder of division. | |
| half | remainder (half x, half y) |
| Remainder of division. | |
| half | remquo (half x, half y, int *quo) |
| Remainder of division. | |
| half | fma (half x, half y, half z) |
| Fused multiply add. | |
| constexpr_NOERR half | fmax (half x, half y) |
| Maximum of half expressions. | |
| constexpr_NOERR half | fmin (half x, half y) |
| Minimum of half expressions. | |
| half | fdim (half x, half y) |
| Positive difference. | |
| half | nanh (const char *arg) |
| Get NaN value. | |
| half | exp (half arg) |
| Exponential function. | |
| half | exp2 (half arg) |
| Binary exponential. | |
| half | expm1 (half arg) |
| Exponential minus one. | |
| half | log (half arg) |
| Natural logarithm. | |
| half | log10 (half arg) |
| Common logarithm. | |
| half | log2 (half arg) |
| Binary logarithm. | |
| half | log1p (half arg) |
| Natural logarithm plus one. | |
| half | sqrt (half arg) |
| Square root. | |
| half | cbrt (half arg) |
| Cubic root. | |
| half | hypot (half x, half y) |
| Hypotenuse function. | |
| half | hypot (half x, half y, half z) |
| Hypotenuse function. | |
| half | pow (half x, half y) |
| Power function. | |
| void | sincos (half arg, half *sin, half *cos) |
| Compute sine and cosine simultaneously. | |
| half | sin (half arg) |
| Sine function. | |
| half | cos (half arg) |
| Cosine function. | |
| half | tan (half arg) |
| Tangent function. | |
| half | asin (half arg) |
| Arc sine. | |
| half | acos (half arg) |
| Arc cosine function. | |
| half | atan (half arg) |
| Arc tangent function. | |
| half | atan2 (half y, half x) |
| Arc tangent function. | |
| half | sinh (half arg) |
| Hyperbolic sine. | |
| half | cosh (half arg) |
| Hyperbolic cosine. | |
| half | tanh (half arg) |
| Hyperbolic tangent. | |
| half | asinh (half arg) |
| Hyperbolic area sine. | |
| half | acosh (half arg) |
| Hyperbolic area cosine. | |
| half | atanh (half arg) |
| Hyperbolic area tangent. | |
| half | erf (half arg) |
| Error function. | |
| half | erfc (half arg) |
| Complementary error function. | |
| half | lgamma (half arg) |
| Natural logarithm of gamma function. | |
| half | tgamma (half arg) |
| Gamma function. | |
| half | ceil (half arg) |
| Nearest integer not less than half value. | |
| half | floor (half arg) |
| Nearest integer not greater than half value. | |
| half | trunc (half arg) |
| Nearest integer not greater in magnitude than half value. | |
| half | round (half arg) |
| Nearest integer. | |
| long | lround (half arg) |
| Nearest integer. | |
| half | rint (half arg) |
| Nearest integer using half's internal rounding mode. | |
| long | lrint (half arg) |
| Nearest integer using half's internal rounding mode. | |
| half | nearbyint (half arg) |
| Nearest integer using half's internal rounding mode. | |
| long long | llround (half arg) |
| Nearest integer. | |
| long long | llrint (half arg) |
| Nearest integer using half's internal rounding mode. | |
| half | frexp (half arg, int *exp) |
| Decompress floating-point number. | |
| half | scalbln (half arg, long exp) |
| Multiply by power of two. | |
| half | modf (half arg, half *iptr) |
| Extract integer and fractional parts. | |
| int | ilogb (half arg) |
| Extract exponent. | |
| half | logb (half arg) |
| Extract exponent. | |
| half | nextafter (half from, half to) |
| Next representable value. | |
| half | nexttoward (half from, long double to) |
| Next representable value. | |
| constexpr half | copysign (half x, half y) |
| Take sign. | |
| constexpr int | fpclassify (half arg) |
| Classify floating-point value. | |
| constexpr bool | isfinite (half arg) |
| Check if finite number. | |
| constexpr bool | isinf (half arg) |
| Check for infinity. | |
| constexpr bool | isnan (half arg) |
| Check for NaN. | |
| constexpr bool | isnormal (half arg) |
| Check if normal number. | |
| constexpr bool | signbit (half arg) |
| Check sign. | |
| constexpr bool | isgreater (half x, half y) |
| Quiet comparison for greater than. | |
| constexpr bool | isgreaterequal (half x, half y) |
| Quiet comparison for greater equal. | |
| constexpr bool | isless (half x, half y) |
| Quiet comparison for less than. | |
| constexpr bool | islessequal (half x, half y) |
| Quiet comparison for less equal. | |
| constexpr bool | islessgreater (half x, half y) |
| Quiet comarison for less or greater. | |
| half | literal::operator""_h (long double) |
Half-precision floating-point type.
This class implements an IEEE-conformant half-precision floating-point type with the usual arithmetic operators and conversions. It is implicitly convertible to single-precision floating-point, which makes artihmetic expressions and functions with mixed-type operands to be of the most precise operand type.
According to the C++98/03 definition, the half type is not a POD type. But according to C++11's less strict and extended definitions it is both a standard layout type and a trivially copyable type (even if not a POD type), which means it can be standard-conformantly copied using raw binary copies. But in this context some more words about the actual size of the type. Although the half is representing an IEEE 16-bit type, it does not neccessarily have to be of exactly 16-bits size. But on any reasonable implementation the actual binary representation of this type will most probably not ivolve any additional "magic" or padding beyond the simple binary representation of the underlying 16-bit IEEE number, even if not strictly guaranteed by the standard. But even then it only has an actual size of 16 bits if your C++ implementation supports an unsigned integer type of exactly 16 bits width. But this should be the case on nearly any reasonable platform.
So if your C++ implementation is not totally exotic or imposes special alignment requirements, it is a reasonable assumption that the data of a half is just comprised of the 2 bytes of the underlying IEEE representation.
Definition at line 1679 of file float16_t.hpp.
|
inlineconstexprnoexcept |
Default constructor.
This initializes the half to 0. Although this does not match the builtin types' default-initialization semantics and may be less efficient than no initialization, it is needed to provide proper value-initialization semantics.
Definition at line 1687 of file float16_t.hpp.
|
inline |
Conversion constructor.
| rhs | float to convert |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding Conversion constructor. |
| rhs | float to convert |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 1698 of file float16_t.hpp.
|
inline |
Definition at line 1795 of file float16_t.hpp.
|
inline |
Conversion to single-precision.
Definition at line 1702 of file float16_t.hpp.
Arithmetic assignment.
| T | type of concrete half expression |
| rhs | half expression to multiply with |
| FE_... | according to operator*(half,half) |
Definition at line 1736 of file float16_t.hpp.
|
inline |
Prefix increment.
| FE_... | according to operator+(half,half) |
Definition at line 1778 of file float16_t.hpp.
|
inline |
Postfix increment.
| FE_... | according to operator+(half,half) |
Definition at line 1788 of file float16_t.hpp.
Arithmetic assignment.
| T | type of concrete half expression |
| rhs | half expression to add |
| FE_... | according to operator+(half,half) |
Definition at line 1722 of file float16_t.hpp.
|
inline |
Prefix decrement.
| FE_... | according to operator-(half,half) |
Definition at line 1783 of file float16_t.hpp.
|
inline |
Postfix decrement.
| FE_... | according to operator-(half,half) |
Definition at line 1793 of file float16_t.hpp.
Arithmetic assignment.
| T | type of concrete half expression |
| rhs | half expression to subtract |
| FE_... | according to operator-(half,half) |
Definition at line 1729 of file float16_t.hpp.
Arithmetic assignment.
| T | type of concrete half expression |
| rhs | half expression to divide by |
| FE_... | according to operator/(half,half) |
Definition at line 1743 of file float16_t.hpp.
|
inline |
Assignment operator.
| rhs | single-precision value to copy from |
| FE_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 1708 of file float16_t.hpp.
|
inline |
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 3181 of file float16_t.hpp.
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 3397 of file float16_t.hpp.
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 3153 of file float16_t.hpp.
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 3370 of file float16_t.hpp.
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 3205 of file float16_t.hpp.
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 3234 of file float16_t.hpp.
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 3421 of file float16_t.hpp.
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_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2795 of file float16_t.hpp.
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 3554 of file float16_t.hpp.
Take sign.
See also: Documentation for std::copysign.
| x | value to change sign for |
| y | value to take sign from |
Definition at line 3818 of file float16_t.hpp.
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 3090 of file float16_t.hpp.
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 3313 of file float16_t.hpp.
|
friend |
Definition at line 1896 of file float16_t.hpp.
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 3453 of file float16_t.hpp.
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 3474 of file float16_t.hpp.
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 2517 of file float16_t.hpp.
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 2549 of file float16_t.hpp.
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 2583 of file float16_t.hpp.
Absolute value.
See also: Documentation for std::fabs.
| arg | operand |
Definition at line 2323 of file float16_t.hpp.
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 2487 of file float16_t.hpp.
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 3562 of file float16_t.hpp.
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 2400 of file float16_t.hpp.
|
friend |
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 2463 of file float16_t.hpp.
|
friend |
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 2474 of file float16_t.hpp.
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 2337 of file float16_t.hpp.
|
friend |
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 3833 of file float16_t.hpp.
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 3635 of file float16_t.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 2840 of file float16_t.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 |
| 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 2881 of file float16_t.hpp.
|
friend |
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 3724 of file float16_t.hpp.
|
friend |
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 3846 of file float16_t.hpp.
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 3887 of file float16_t.hpp.
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 3897 of file float16_t.hpp.
|
friend |
Check for infinity.
See also: Documentation for std::isinf.
| arg | number to check |
| true | for positive or negative infinity |
| false | else |
Definition at line 3853 of file float16_t.hpp.
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 3907 of file float16_t.hpp.
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 3917 of file float16_t.hpp.
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 3927 of file float16_t.hpp.
|
friend |
Check for NaN.
See also: Documentation for std::isnan.
| arg | number to check |
| true | for NaNs |
| false | else |
Definition at line 3860 of file float16_t.hpp.
|
friend |
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 3867 of file float16_t.hpp.
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 3498 of file float16_t.hpp.
|
friend |
|
friend |
Nearest integer using half's internal rounding mode.
See also: Documentation for std::llrint.
| arg | half expression to round |
| FE_INVALID | if value is not representable as `long long` |
| FE_INEXACT | if value had to be rounded |
Definition at line 3622 of file float16_t.hpp.
|
friend |
Nearest integer.
See also: Documentation for std::llround.
| arg | half to round |
| FE_INVALID | if value is not representable as `long long` |
Definition at line 3614 of file float16_t.hpp.
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 2630 of file float16_t.hpp.
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 2657 of file float16_t.hpp.
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 2731 of file float16_t.hpp.
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 2690 of file float16_t.hpp.
Extract exponent.
See also: Documentation for std::logb.
| arg | number to query |
| FE_INVALID | for signaling NaN |
| FE_DIVBYZERO | for 0 |
Definition at line 3747 of file float16_t.hpp.
|
friend |
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 3601 of file float16_t.hpp.
|
friend |
Nearest integer.
See also: Documentation for std::lround.
| arg | half to round |
| FE_INVALID | if value is not representable as `long` |
Definition at line 3585 of file float16_t.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 3698 of file float16_t.hpp.
|
friend |
Get NaN value.
See also: Documentation for std::nan.
| arg | string code |
Definition at line 2497 of file float16_t.hpp.
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 3608 of file float16_t.hpp.
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 3771 of file float16_t.hpp.
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 3796 of file float16_t.hpp.
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 2208 of file float16_t.hpp.
Definition at line 2232 of file float16_t.hpp.
Definition at line 2234 of file float16_t.hpp.
Identity.
| arg | operand |
Definition at line 2127 of file float16_t.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 2141 of file float16_t.hpp.
Definition at line 2178 of file float16_t.hpp.
Definition at line 2180 of file float16_t.hpp.
Negation.
| arg | operand |
Definition at line 2132 of file float16_t.hpp.
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 2189 of file float16_t.hpp.
Definition at line 2197 of file float16_t.hpp.
Definition at line 2199 of file float16_t.hpp.
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 2244 of file float16_t.hpp.
Definition at line 2272 of file float16_t.hpp.
Definition at line 2274 of file float16_t.hpp.
|
friend |
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 2274 of file float16_t.hpp.
|
friend |
Definition at line 2103 of file float16_t.hpp.
|
friend |
Definition at line 2114 of file float16_t.hpp.
|
friend |
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 2097 of file float16_t.hpp.
|
friend |
Definition at line 2101 of file float16_t.hpp.
|
friend |
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 2303 of file float16_t.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 2944 of file float16_t.hpp.
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 2357 of file float16_t.hpp.
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 2376 of file float16_t.hpp.
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 3593 of file float16_t.hpp.
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 3578 of file float16_t.hpp.
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 3654 of file float16_t.hpp.
|
friend |
Check sign.
See also: Documentation for std::signbit.
| arg | number to check |
| true | for negative number |
| false | for positive number |
Definition at line 3874 of file float16_t.hpp.
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 3059 of file float16_t.hpp.
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 3003 of file float16_t.hpp.
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 3286 of file float16_t.hpp.
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_OVERFLOW,...UNDERFLOW,...INEXACT | according to rounding |
Definition at line 2774 of file float16_t.hpp.
|
friend |
Definition at line 1896 of file float16_t.hpp.
|
friend |
Definition at line 1896 of file float16_t.hpp.
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 3118 of file float16_t.hpp.
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 3339 of file float16_t.hpp.
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 3522 of file float16_t.hpp.
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 3570 of file float16_t.hpp.