NVIDIA DeepStream SDK API Reference

9.2 Release
half_float::half Class Reference

Detailed Description

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 2072 of file includes/half.hpp.

Public Member Functions

Construction and assignment
HALF_CONSTEXPR half () HALF_NOEXCEPT
 Default constructor. More...
 
 half (float rhs)
 Conversion constructor. More...
 
 operator float () const
 Conversion to single-precision. More...
 
half & operator= (float rhs)
 Assignment operator. More...
 
HALF_CONSTEXPR half () HALF_NOEXCEPT
 Default constructor. More...
 
 half (float rhs)
 Conversion constructor. More...
 
 operator float () const
 Conversion to single-precision. More...
 
half & operator= (float rhs)
 Assignment operator. More...
 
Arithmetic updates
half & operator+= (half rhs)
 Arithmetic assignment. More...
 
half & operator-= (half rhs)
 Arithmetic assignment. More...
 
half & operator*= (half rhs)
 Arithmetic assignment. More...
 
half & operator/= (half rhs)
 Arithmetic assignment. More...
 
half & operator+= (float rhs)
 Arithmetic assignment. More...
 
half & operator-= (float rhs)
 Arithmetic assignment. More...
 
half & operator*= (float rhs)
 Arithmetic assignment. More...
 
half & operator/= (float rhs)
 Arithmetic assignment. More...
 
half & operator+= (half rhs)
 Arithmetic assignment. More...
 
half & operator-= (half rhs)
 Arithmetic assignment. More...
 
half & operator*= (half rhs)
 Arithmetic assignment. More...
 
half & operator/= (half rhs)
 Arithmetic assignment. More...
 
half & operator+= (float rhs)
 Arithmetic assignment. More...
 
half & operator-= (float rhs)
 Arithmetic assignment. More...
 
half & operator*= (float rhs)
 Arithmetic assignment. More...
 
half & operator/= (float rhs)
 Arithmetic assignment. More...
 
Increment and decrement
half & operator++ ()
 Prefix increment. More...
 
half & operator-- ()
 Prefix decrement. More...
 
half operator++ (int)
 Postfix increment. More...
 
half operator-- (int)
 Postfix decrement. More...
 
half & operator++ ()
 Prefix increment. More...
 
half & operator-- ()
 Prefix decrement. More...
 
half operator++ (int)
 Postfix increment. More...
 
half operator-- (int)
 Postfix decrement. More...
 

Friends

template<typename , typename , std::float_round_style >
struct detail::half_caster
 
class std::numeric_limits< half >
 
HALF_CONSTEXPR_NOERR bool operator== (half, half)
 Comparison for equality. More...
 
HALF_CONSTEXPR_NOERR bool operator!= (half, half)
 Comparison for inequality. More...
 
HALF_CONSTEXPR_NOERR bool operator< (half, half)
 Comparison for less than. More...
 
HALF_CONSTEXPR_NOERR bool operator> (half, half)
 Comparison for greater than. More...
 
HALF_CONSTEXPR_NOERR bool operator<= (half, half)
 Comparison for less equal. More...
 
HALF_CONSTEXPR_NOERR bool operator>= (half, half)
 Comparison for greater equal. More...
 
HALF_CONSTEXPR half operator- (half)
 Negation. More...
 
half operator+ (half, half)
 Addition. More...
 
half operator- (half, half)
 Subtraction. More...
 
half operator* (half, half)
 Multiplication. More...
 
half operator/ (half, half)
 Division. More...
 
template<typename charT , typename traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &, half)
 Output operator. More...
 
template<typename charT , typename traits >
std::basic_istream< charT, traits > & operator>> (std::basic_istream< charT, traits > &, half &)
 Input operator. More...
 
HALF_CONSTEXPR half fabs (half)
 Absolute value. More...
 
half fmod (half, half)
 Remainder of division. More...
 
half remainder (half, half)
 Remainder of division. More...
 
half remquo (half, half, int *)
 Remainder of division. More...
 
half fma (half, half, half)
 Fused multiply add. More...
 
HALF_CONSTEXPR_NOERR half fmax (half, half)
 Maximum of half expressions. More...
 
HALF_CONSTEXPR_NOERR half fmin (half, half)
 Minimum of half expressions. More...
 
half fdim (half, half)
 Positive difference. More...
 
half nanh (const char *)
 Get NaN value. More...
 
half exp (half)
 Exponential function. More...
 
half exp2 (half)
 Binary exponential. More...
 
half expm1 (half)
 Exponential minus one. More...
 
half log (half)
 Natural logarithm. More...
 
half log10 (half)
 Common logarithm. More...
 
half log2 (half)
 Binary logarithm. More...
 
half log1p (half)
 Natural logarithm plus one. More...
 
half sqrt (half)
 Square root. More...
 
half rsqrt (half)
 Inverse square root. More...
 
half cbrt (half)
 Cubic root. More...
 
half hypot (half, half)
 Hypotenuse function. More...
 
half hypot (half, half, half)
 Hypotenuse function. More...
 
half pow (half, half)
 Power function. More...
 
void sincos (half, half *, half *)
 Compute sine and cosine simultaneously. More...
 
half sin (half)
 Sine function. More...
 
half cos (half)
 Cosine function. More...
 
half tan (half)
 Tangent function. More...
 
half asin (half)
 Arc sine. More...
 
half acos (half)
 Arc cosine function. More...
 
half atan (half)
 Arc tangent function. More...
 
half atan2 (half, half)
 Arc tangent function. More...
 
half sinh (half)
 Hyperbolic sine. More...
 
half cosh (half)
 Hyperbolic cosine. More...
 
half tanh (half)
 Hyperbolic tangent. More...
 
half asinh (half)
 Hyperbolic area sine. More...
 
half acosh (half)
 Hyperbolic area cosine. More...
 
half atanh (half)
 Hyperbolic area tangent. More...
 
half erf (half)
 Error function. More...
 
half erfc (half)
 Complementary error function. More...
 
half lgamma (half)
 Natural logarithm of gamma function. More...
 
half tgamma (half)
 Gamma function. More...
 
half ceil (half)
 Nearest integer not less than half value. More...
 
half floor (half)
 Nearest integer not greater than half value. More...
 
half trunc (half)
 Nearest integer not greater in magnitude than half value. More...
 
half round (half)
 Nearest integer. More...
 
long lround (half)
 Nearest integer. More...
 
half rint (half)
 Nearest integer using half's internal rounding mode. More...
 
long lrint (half)
 Nearest integer using half's internal rounding mode. More...
 
half nearbyint (half)
 Nearest integer using half's internal rounding mode. More...
 
half frexp (half, int *)
 Decompress floating-point number. More...
 
half scalbln (half, long)
 Multiply by power of two. More...
 
half modf (half, half *)
 Extract integer and fractional parts. More...
 
int ilogb (half)
 Extract exponent. More...
 
half logb (half)
 Extract exponent. More...
 
half nextafter (half, half)
 Next representable value. More...
 
half nexttoward (half, long double)
 Next representable value. More...
 
HALF_CONSTEXPR half copysign (half, half)
 Take sign. More...
 
HALF_CONSTEXPR int fpclassify (half)
 Classify floating-point value. More...
 
HALF_CONSTEXPR bool isfinite (half)
 Check if finite number. More...
 
HALF_CONSTEXPR bool isinf (half)
 Check for infinity. More...
 
HALF_CONSTEXPR bool isnan (half)
 Check for NaN. More...
 
HALF_CONSTEXPR bool isnormal (half)
 Check if normal number. More...
 
HALF_CONSTEXPR bool signbit (half)
 Check sign. More...
 
HALF_CONSTEXPR bool isgreater (half, half)
 Quiet comparison for greater than. More...
 
HALF_CONSTEXPR bool isgreaterequal (half, half)
 Quiet comparison for greater equal. More...
 
HALF_CONSTEXPR bool isless (half, half)
 Quiet comparison for less than. More...
 
HALF_CONSTEXPR bool islessequal (half, half)
 Quiet comparison for less equal. More...
 
HALF_CONSTEXPR bool islessgreater (half, half)
 Quiet comarison for less or greater. More...
 
HALF_CONSTEXPR_NOERR bool operator== (half, half)
 Comparison for equality. More...
 
HALF_CONSTEXPR_NOERR bool operator!= (half, half)
 Comparison for inequality. More...
 
HALF_CONSTEXPR_NOERR bool operator< (half, half)
 Comparison for less than. More...
 
HALF_CONSTEXPR_NOERR bool operator> (half, half)
 Comparison for greater than. More...
 
HALF_CONSTEXPR_NOERR bool operator<= (half, half)
 Comparison for less equal. More...
 
HALF_CONSTEXPR_NOERR bool operator>= (half, half)
 Comparison for greater equal. More...
 
HALF_CONSTEXPR half operator- (half)
 Negation. More...
 
half operator+ (half, half)
 Addition. More...
 
half operator- (half, half)
 Subtraction. More...
 
half operator* (half, half)
 Multiplication. More...
 
half operator/ (half, half)
 Division. More...
 
template<typename charT , typename traits >
std::basic_ostream< charT, traits > & operator<< (std::basic_ostream< charT, traits > &, half)
 Output operator. More...
 
template<typename charT , typename traits >
std::basic_istream< charT, traits > & operator>> (std::basic_istream< charT, traits > &, half &)
 Input operator. More...
 
HALF_CONSTEXPR half fabs (half)
 Absolute value. More...
 
half fmod (half, half)
 Remainder of division. More...
 
half remainder (half, half)
 Remainder of division. More...
 
half remquo (half, half, int *)
 Remainder of division. More...
 
half fma (half, half, half)
 Fused multiply add. More...
 
HALF_CONSTEXPR_NOERR half fmax (half, half)
 Maximum of half expressions. More...
 
HALF_CONSTEXPR_NOERR half fmin (half, half)
 Minimum of half expressions. More...
 
half fdim (half, half)
 Positive difference. More...
 
half nanh (const char *)
 Get NaN value. More...
 
half exp (half)
 Exponential function. More...
 
half exp2 (half)
 Binary exponential. More...
 
half expm1 (half)
 Exponential minus one. More...
 
half log (half)
 Natural logarithm. More...
 
half log10 (half)
 Common logarithm. More...
 
half log2 (half)
 Binary logarithm. More...
 
half log1p (half)
 Natural logarithm plus one. More...
 
half sqrt (half)
 Square root. More...
 
half rsqrt (half)
 Inverse square root. More...
 
half cbrt (half)
 Cubic root. More...
 
half hypot (half, half)
 Hypotenuse function. More...
 
half hypot (half, half, half)
 Hypotenuse function. More...
 
half pow (half, half)
 Power function. More...
 
void sincos (half, half *, half *)
 Compute sine and cosine simultaneously. More...
 
half sin (half)
 Sine function. More...
 
half cos (half)
 Cosine function. More...
 
half tan (half)
 Tangent function. More...
 
half asin (half)
 Arc sine. More...
 
half acos (half)
 Arc cosine function. More...
 
half atan (half)
 Arc tangent function. More...
 
half atan2 (half, half)
 Arc tangent function. More...
 
half sinh (half)
 Hyperbolic sine. More...
 
half cosh (half)
 Hyperbolic cosine. More...
 
half tanh (half)
 Hyperbolic tangent. More...
 
half asinh (half)
 Hyperbolic area sine. More...
 
half acosh (half)
 Hyperbolic area cosine. More...
 
half atanh (half)
 Hyperbolic area tangent. More...
 
half erf (half)
 Error function. More...
 
half erfc (half)
 Complementary error function. More...
 
half lgamma (half)
 Natural logarithm of gamma function. More...
 
half tgamma (half)
 Gamma function. More...
 
half ceil (half)
 Nearest integer not less than half value. More...
 
half floor (half)
 Nearest integer not greater than half value. More...
 
half trunc (half)
 Nearest integer not greater in magnitude than half value. More...
 
half round (half)
 Nearest integer. More...
 
long lround (half)
 Nearest integer. More...
 
half rint (half)
 Nearest integer using half's internal rounding mode. More...
 
long lrint (half)
 Nearest integer using half's internal rounding mode. More...
 
half nearbyint (half)
 Nearest integer using half's internal rounding mode. More...
 
half frexp (half, int *)
 Decompress floating-point number. More...
 
half scalbln (half, long)
 Multiply by power of two. More...
 
half modf (half, half *)
 Extract integer and fractional parts. More...
 
int ilogb (half)
 Extract exponent. More...
 
half logb (half)
 Extract exponent. More...
 
half nextafter (half, half)
 Next representable value. More...
 
half nexttoward (half, long double)
 Next representable value. More...
 
HALF_CONSTEXPR half copysign (half, half)
 Take sign. More...
 
HALF_CONSTEXPR int fpclassify (half)
 Classify floating-point value. More...
 
HALF_CONSTEXPR bool isfinite (half)
 Check if finite number. More...
 
HALF_CONSTEXPR bool isinf (half)
 Check for infinity. More...
 
HALF_CONSTEXPR bool isnan (half)
 Check for NaN. More...
 
HALF_CONSTEXPR bool isnormal (half)
 Check if normal number. More...
 
HALF_CONSTEXPR bool signbit (half)
 Check sign. More...
 
HALF_CONSTEXPR bool isgreater (half, half)
 Quiet comparison for greater than. More...
 
HALF_CONSTEXPR bool isgreaterequal (half, half)
 Quiet comparison for greater equal. More...
 
HALF_CONSTEXPR bool isless (half, half)
 Quiet comparison for less than. More...
 
HALF_CONSTEXPR bool islessequal (half, half)
 Quiet comparison for less equal. More...
 
HALF_CONSTEXPR bool islessgreater (half, half)
 Quiet comarison for less or greater. More...
 
template<typename , typename , std::float_round_style >
struct detail::half_caster
 

Constructor & Destructor Documentation

◆ half() [1/4]

HALF_CONSTEXPR half_float::half::half ( )
inline

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 2081 of file includes/half.hpp.

Referenced by operator++(), and operator--().

◆ half() [2/4]

half_float::half::half ( float  rhs)
inlineexplicit

Conversion constructor.

Parameters
rhsfloat to convert
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2086 of file includes/half.hpp.

◆ half() [3/4]

HALF_CONSTEXPR half_float::half::half ( )
inline

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 2081 of file 9.2/includes/half.hpp.

◆ half() [4/4]

half_float::half::half ( float  rhs)
inlineexplicit

Conversion constructor.

Parameters
rhsfloat to convert
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2086 of file 9.2/includes/half.hpp.

Member Function Documentation

◆ operator float() [1/2]

half_float::half::operator float ( ) const
inline

Conversion to single-precision.

Returns
single precision value representing expression value

Definition at line 2090 of file includes/half.hpp.

◆ operator float() [2/2]

half_float::half::operator float ( ) const
inline

Conversion to single-precision.

Returns
single precision value representing expression value

Definition at line 2090 of file 9.2/includes/half.hpp.

◆ operator*=() [1/4]

half& half_float::half::operator*= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to multiply with
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2146 of file includes/half.hpp.

◆ operator*=() [2/4]

half& half_float::half::operator*= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to multiply with
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2146 of file 9.2/includes/half.hpp.

◆ operator*=() [3/4]

half& half_float::half::operator*= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to multiply with
Returns
reference to this half
Exceptions
FE_...according to operator*(half,half)

Definition at line 2121 of file includes/half.hpp.

◆ operator*=() [4/4]

half& half_float::half::operator*= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to multiply with
Returns
reference to this half
Exceptions
FE_...according to operator*(half,half)

Definition at line 2121 of file 9.2/includes/half.hpp.

◆ operator++() [1/4]

half& half_float::half::operator++ ( )
inline

Prefix increment.

Returns
incremented half value
Exceptions
FE_...according to operator+(half,half)

Definition at line 2161 of file includes/half.hpp.

References half_float::detail::binary, and half().

◆ operator++() [2/4]

half& half_float::half::operator++ ( )
inline

Prefix increment.

Returns
incremented half value
Exceptions
FE_...according to operator+(half,half)

Definition at line 2161 of file 9.2/includes/half.hpp.

References half_float::detail::binary, and half().

◆ operator++() [3/4]

half half_float::half::operator++ ( int  )
inline

Postfix increment.

Returns
non-incremented half value
Exceptions
FE_...according to operator+(half,half)

Definition at line 2171 of file 9.2/includes/half.hpp.

◆ operator++() [4/4]

half half_float::half::operator++ ( int  )
inline

Postfix increment.

Returns
non-incremented half value
Exceptions
FE_...according to operator+(half,half)

Definition at line 2171 of file includes/half.hpp.

◆ operator+=() [1/4]

half& half_float::half::operator+= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to add
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2134 of file 9.2/includes/half.hpp.

◆ operator+=() [2/4]

half& half_float::half::operator+= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to add
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2134 of file includes/half.hpp.

◆ operator+=() [3/4]

half& half_float::half::operator+= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to add
Returns
reference to this half
Exceptions
FE_...according to operator+(half,half)

Definition at line 2107 of file 9.2/includes/half.hpp.

◆ operator+=() [4/4]

half& half_float::half::operator+= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to add
Returns
reference to this half
Exceptions
FE_...according to operator+(half,half)

Definition at line 2107 of file includes/half.hpp.

◆ operator--() [1/4]

half& half_float::half::operator-- ( )
inline

Prefix decrement.

Returns
decremented half value
Exceptions
FE_...according to operator-(half,half)

Definition at line 2166 of file includes/half.hpp.

References half_float::detail::binary, and half().

◆ operator--() [2/4]

half& half_float::half::operator-- ( )
inline

Prefix decrement.

Returns
decremented half value
Exceptions
FE_...according to operator-(half,half)

Definition at line 2166 of file 9.2/includes/half.hpp.

References half_float::detail::binary, and half().

◆ operator--() [3/4]

half half_float::half::operator-- ( int  )
inline

Postfix decrement.

Returns
non-decremented half value
Exceptions
FE_...according to operator-(half,half)

Definition at line 2176 of file 9.2/includes/half.hpp.

◆ operator--() [4/4]

half half_float::half::operator-- ( int  )
inline

Postfix decrement.

Returns
non-decremented half value
Exceptions
FE_...according to operator-(half,half)

Definition at line 2176 of file includes/half.hpp.

◆ operator-=() [1/4]

half& half_float::half::operator-= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to subtract
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2140 of file includes/half.hpp.

◆ operator-=() [2/4]

half& half_float::half::operator-= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to subtract
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2140 of file 9.2/includes/half.hpp.

◆ operator-=() [3/4]

half& half_float::half::operator-= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to subtract
Returns
reference to this half
Exceptions
FE_...according to operator-(half,half)

Definition at line 2114 of file includes/half.hpp.

◆ operator-=() [4/4]

half& half_float::half::operator-= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to subtract
Returns
reference to this half
Exceptions
FE_...according to operator-(half,half)

Definition at line 2114 of file 9.2/includes/half.hpp.

◆ operator/=() [1/4]

half& half_float::half::operator/= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to divide by
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2152 of file 9.2/includes/half.hpp.

◆ operator/=() [2/4]

half& half_float::half::operator/= ( float  rhs)
inline

Arithmetic assignment.

Parameters
rhssingle-precision value to divide by
Returns
reference to this half
Exceptions
FE_...according to operator=()

Definition at line 2152 of file includes/half.hpp.

◆ operator/=() [3/4]

half& half_float::half::operator/= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to divide by
Returns
reference to this half
Exceptions
FE_...according to operator/(half,half)

Definition at line 2128 of file 9.2/includes/half.hpp.

◆ operator/=() [4/4]

half& half_float::half::operator/= ( half  rhs)
inline

Arithmetic assignment.

Template Parameters
Ttype of concrete half expression
Parameters
rhshalf expression to divide by
Returns
reference to this half
Exceptions
FE_...according to operator/(half,half)

Definition at line 2128 of file includes/half.hpp.

◆ operator=() [1/2]

half& half_float::half::operator= ( float  rhs)
inline

Assignment operator.

Parameters
rhssingle-precision value to copy from
Returns
reference to this half
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2096 of file 9.2/includes/half.hpp.

◆ operator=() [2/2]

half& half_float::half::operator= ( float  rhs)
inline

Assignment operator.

Parameters
rhssingle-precision value to copy from
Returns
reference to this half
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2096 of file includes/half.hpp.

Friends And Related Function Documentation

◆ acos [1/2]

half acos ( half  arg)
friend

Arc cosine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::acos.

Parameters
argfunction argument
Returns
arc cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3700 of file includes/half.hpp.

◆ acos [2/2]

half acos ( half  arg)
friend

Arc cosine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::acos.

Parameters
argfunction argument
Returns
arc cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3700 of file includes/half.hpp.

◆ acosh [1/2]

half acosh ( half  arg)
friend

Hyperbolic area cosine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::acosh.

Parameters
argfunction argument
Returns
area cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or arguments <1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3925 of file includes/half.hpp.

◆ acosh [2/2]

half acosh ( half  arg)
friend

Hyperbolic area cosine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::acosh.

Parameters
argfunction argument
Returns
area cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or arguments <1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3925 of file includes/half.hpp.

◆ asin [1/2]

half asin ( half  arg)
friend

Arc sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::asin.

Parameters
argfunction argument
Returns
arc sine value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3671 of file includes/half.hpp.

◆ asin [2/2]

half asin ( half  arg)
friend

Arc sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::asin.

Parameters
argfunction argument
Returns
arc sine value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3671 of file includes/half.hpp.

◆ asinh [1/2]

half asinh ( half  arg)
friend

Hyperbolic area sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::asinh.

Parameters
argfunction argument
Returns
area sine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3897 of file includes/half.hpp.

◆ asinh [2/2]

half asinh ( half  arg)
friend

Hyperbolic area sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::asinh.

Parameters
argfunction argument
Returns
area sine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3897 of file includes/half.hpp.

◆ atan [1/2]

half atan ( half  arg)
friend

Arc tangent function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::atan.

Parameters
argfunction argument
Returns
arc tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3725 of file includes/half.hpp.

◆ atan [2/2]

half atan ( half  arg)
friend

Arc tangent function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::atan.

Parameters
argfunction argument
Returns
arc tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3725 of file includes/half.hpp.

◆ atan2 [1/2]

half atan2 ( half  y,
half  x 
)
friend

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.

Parameters
ynumerator
xdenominator
Returns
arc tangent value
Exceptions
FE_INVALIDif x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3755 of file includes/half.hpp.

◆ atan2 [2/2]

half atan2 ( half  y,
half  x 
)
friend

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.

Parameters
ynumerator
xdenominator
Returns
arc tangent value
Exceptions
FE_INVALIDif x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3755 of file includes/half.hpp.

◆ atanh [1/2]

half atanh ( half  arg)
friend

Hyperbolic area tangent.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::atanh.

Parameters
argfunction argument
Returns
area tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_DIVBYZEROfor +/-1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3950 of file includes/half.hpp.

◆ atanh [2/2]

half atanh ( half  arg)
friend

Hyperbolic area tangent.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::atanh.

Parameters
argfunction argument
Returns
area tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN or if abs(arg) > 1
FE_DIVBYZEROfor +/-1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3950 of file includes/half.hpp.

◆ cbrt [1/2]

half cbrt ( half  arg)
friend

Cubic root.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cbrt.

Parameters
argfunction argument
Returns
cubic root of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTaccording to rounding

Definition at line 3281 of file includes/half.hpp.

◆ cbrt [2/2]

half cbrt ( half  arg)
friend

Cubic root.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cbrt.

Parameters
argfunction argument
Returns
cubic root of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTaccording to rounding

Definition at line 3281 of file includes/half.hpp.

◆ ceil [1/2]

half ceil ( half  arg)
friend

Nearest integer not less than half value.

See also: Documentation for std::ceil.

Parameters
arghalf to round
Returns
nearest integer not less than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4088 of file includes/half.hpp.

◆ ceil [2/2]

half ceil ( half  arg)
friend

Nearest integer not less than half value.

See also: Documentation for std::ceil.

Parameters
arghalf to round
Returns
nearest integer not less than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4088 of file includes/half.hpp.

◆ copysign [1/2]

HALF_CONSTEXPR half copysign ( half  x,
half  y 
)
friend

Take sign.

See also: Documentation for std::copysign.

Parameters
xvalue to change sign for
yvalue to take sign from
Returns
value equal to x in magnitude and to y in sign

Definition at line 4359 of file includes/half.hpp.

◆ copysign [2/2]

HALF_CONSTEXPR half copysign ( half  x,
half  y 
)
friend

Take sign.

See also: Documentation for std::copysign.

Parameters
xvalue to change sign for
yvalue to take sign from
Returns
value equal to x in magnitude and to y in sign

Definition at line 4359 of file includes/half.hpp.

◆ cos [1/2]

half cos ( half  arg)
friend

Cosine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cos.

Parameters
argfunction argument
Returns
cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3606 of file includes/half.hpp.

◆ cos [2/2]

half cos ( half  arg)
friend

Cosine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cos.

Parameters
argfunction argument
Returns
cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3606 of file includes/half.hpp.

◆ cosh [1/2]

half cosh ( half  arg)
friend

Hyperbolic cosine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cosh.

Parameters
argfunction argument
Returns
hyperbolic cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3838 of file includes/half.hpp.

◆ cosh [2/2]

half cosh ( half  arg)
friend

Hyperbolic cosine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::cosh.

Parameters
argfunction argument
Returns
hyperbolic cosine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3838 of file includes/half.hpp.

◆ detail::half_caster [1/2]

template<typename , typename , std::float_round_style >
struct detail::half_caster
friend

Definition at line 2275 of file 9.2/includes/half.hpp.

◆ detail::half_caster [2/2]

template<typename , typename , std::float_round_style >
friend struct detail::half_caster
friend

Definition at line 2275 of file includes/half.hpp.

◆ erf [1/2]

half erf ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
error function value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3983 of file includes/half.hpp.

◆ erf [2/2]

half erf ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
error function value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3983 of file includes/half.hpp.

◆ erfc [1/2]

half erfc ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
1 minus error function value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4005 of file includes/half.hpp.

◆ erfc [2/2]

half erfc ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
1 minus error function value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4005 of file includes/half.hpp.

◆ exp [1/2]

half exp ( half  arg)
friend

Exponential function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::exp.

Parameters
argfunction argument
Returns
e raised to arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2953 of file includes/half.hpp.

◆ exp [2/2]

half exp ( half  arg)
friend

Exponential function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::exp.

Parameters
argfunction argument
Returns
e raised to arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2953 of file includes/half.hpp.

◆ exp2 [1/2]

half exp2 ( half  arg)
friend

Binary exponential.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::exp2.

Parameters
argfunction argument
Returns
2 raised to arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2988 of file includes/half.hpp.

◆ exp2 [2/2]

half exp2 ( half  arg)
friend

Binary exponential.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::exp2.

Parameters
argfunction argument
Returns
2 raised to arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2988 of file includes/half.hpp.

◆ expm1 [1/2]

half expm1 ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
e raised to arg and subtracted by 1
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3014 of file includes/half.hpp.

◆ expm1 [2/2]

half expm1 ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
e raised to arg and subtracted by 1
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3014 of file includes/half.hpp.

◆ fabs [1/2]

HALF_CONSTEXPR half fabs ( half  arg)
friend

Absolute value.

See also: Documentation for std::fabs.

Parameters
argoperand
Returns
absolute value of arg

Definition at line 2746 of file includes/half.hpp.

◆ fabs [2/2]

HALF_CONSTEXPR half fabs ( half  arg)
friend

Absolute value.

See also: Documentation for std::fabs.

Parameters
argoperand
Returns
absolute value of arg

Definition at line 2746 of file includes/half.hpp.

◆ fdim [1/2]

half fdim ( half  x,
half  y 
)
friend

Positive difference.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::fdim.

Parameters
xfirst operand
ysecond operand
Returns
x - y or 0 if difference negative
Exceptions
FE_...according to operator-(half,half)

Definition at line 2921 of file includes/half.hpp.

◆ fdim [2/2]

half fdim ( half  x,
half  y 
)
friend

Positive difference.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::fdim.

Parameters
xfirst operand
ysecond operand
Returns
x - y or 0 if difference negative
Exceptions
FE_...according to operator-(half,half)

Definition at line 2921 of file includes/half.hpp.

◆ floor [1/2]

half floor ( half  arg)
friend

Nearest integer not greater than half value.

See also: Documentation for std::floor.

Parameters
arghalf to round
Returns
nearest integer not greater than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4096 of file includes/half.hpp.

◆ floor [2/2]

half floor ( half  arg)
friend

Nearest integer not greater than half value.

See also: Documentation for std::floor.

Parameters
arghalf to round
Returns
nearest integer not greater than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4096 of file includes/half.hpp.

◆ fma [1/2]

half fma ( half  x,
half  y,
half  z 
)
friend

Fused multiply add.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::fma.

Parameters
xfirst operand
ysecond operand
zthird operand
Returns
( x * y ) + z rounded as one operation.
Exceptions
FE_INVALIDaccording to operator*() and operator+() unless any argument is a quiet NaN and no argument is a signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding the final addition

Definition at line 2826 of file includes/half.hpp.

◆ fma [2/2]

half fma ( half  x,
half  y,
half  z 
)
friend

Fused multiply add.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::fma.

Parameters
xfirst operand
ysecond operand
zthird operand
Returns
( x * y ) + z rounded as one operation.
Exceptions
FE_INVALIDaccording to operator*() and operator+() unless any argument is a quiet NaN and no argument is a signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding the final addition

Definition at line 2826 of file includes/half.hpp.

◆ fmax [1/2]

HALF_CONSTEXPR_NOERR half fmax ( half  x,
half  y 
)
friend

Maximum of half expressions.

See also: Documentation for std::fmax.

Parameters
xfirst operand
ysecond operand
Returns
maximum of operands, ignoring quiet NaNs
Exceptions
FE_INVALIDif x or y is signaling NaN

Definition at line 2895 of file includes/half.hpp.

◆ fmax [2/2]

HALF_CONSTEXPR_NOERR half fmax ( half  x,
half  y 
)
friend

Maximum of half expressions.

See also: Documentation for std::fmax.

Parameters
xfirst operand
ysecond operand
Returns
maximum of operands, ignoring quiet NaNs
Exceptions
FE_INVALIDif x or y is signaling NaN

Definition at line 2895 of file includes/half.hpp.

◆ fmin [1/2]

HALF_CONSTEXPR_NOERR half fmin ( half  x,
half  y 
)
friend

Minimum of half expressions.

See also: Documentation for std::fmin.

Parameters
xfirst operand
ysecond operand
Returns
minimum of operands, ignoring quiet NaNs
Exceptions
FE_INVALIDif x or y is signaling NaN

Definition at line 2907 of file includes/half.hpp.

◆ fmin [2/2]

HALF_CONSTEXPR_NOERR half fmin ( half  x,
half  y 
)
friend

Minimum of half expressions.

See also: Documentation for std::fmin.

Parameters
xfirst operand
ysecond operand
Returns
minimum of operands, ignoring quiet NaNs
Exceptions
FE_INVALIDif x or y is signaling NaN

Definition at line 2907 of file includes/half.hpp.

◆ fmod [1/2]

half fmod ( half  x,
half  y 
)
friend

Remainder of division.

See also: Documentation for std::fmod.

Parameters
xfirst operand
ysecond operand
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2760 of file includes/half.hpp.

◆ fmod [2/2]

half fmod ( half  x,
half  y 
)
friend

Remainder of division.

See also: Documentation for std::fmod.

Parameters
xfirst operand
ysecond operand
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2760 of file includes/half.hpp.

◆ fpclassify [1/2]

HALF_CONSTEXPR int fpclassify ( half  arg)
friend

Classify floating-point value.

See also: Documentation for std::fpclassify.

Parameters
argnumber to classify
Return values
FP_ZEROfor positive and negative zero
FP_SUBNORMALfor subnormal numbers
FP_INFINITYfor positive and negative infinity
FP_NANfor NaNs
FP_NORMALfor all other (normal) values

Definition at line 4374 of file includes/half.hpp.

◆ fpclassify [2/2]

HALF_CONSTEXPR int fpclassify ( half  arg)
friend

Classify floating-point value.

See also: Documentation for std::fpclassify.

Parameters
argnumber to classify
Return values
FP_ZEROfor positive and negative zero
FP_SUBNORMALfor subnormal numbers
FP_INFINITYfor positive and negative infinity
FP_NANfor NaNs
FP_NORMALfor all other (normal) values

Definition at line 4374 of file includes/half.hpp.

◆ frexp [1/2]

half frexp ( half  arg,
int *  exp 
)
friend

Decompress floating-point number.

See also: Documentation for std::frexp.

Parameters
argnumber to decompress
expaddress to store exponent at
Returns
significant in range [0.5, 1)
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4171 of file includes/half.hpp.

◆ frexp [2/2]

half frexp ( half  arg,
int *  exp 
)
friend

Decompress floating-point number.

See also: Documentation for std::frexp.

Parameters
argnumber to decompress
expaddress to store exponent at
Returns
significant in range [0.5, 1)
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4171 of file includes/half.hpp.

◆ hypot [1/4]

half hypot ( half  x,
half  y 
)
friend

Hypotenuse function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::hypot.

Parameters
xfirst argument
ysecond argument
Returns
square root of sum of squares without internal over- or underflows
Exceptions
FE_INVALIDif x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding of the final square root

Definition at line 3332 of file includes/half.hpp.

◆ hypot [2/4]

half hypot ( half  x,
half  y 
)
friend

Hypotenuse function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::hypot.

Parameters
xfirst argument
ysecond argument
Returns
square root of sum of squares without internal over- or underflows
Exceptions
FE_INVALIDif x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding of the final square root

Definition at line 3332 of file includes/half.hpp.

◆ hypot [3/4]

half hypot ( half  x,
half  y,
half  z 
)
friend

Hypotenuse function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::hypot.

Parameters
xfirst argument
ysecond argument
zthird argument
Returns
square root of sum of squares without internal over- or underflows
Exceptions
FE_INVALIDif x, y or z is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding of the final square root

Definition at line 3378 of file includes/half.hpp.

◆ hypot [4/4]

half hypot ( half  x,
half  y,
half  z 
)
friend

Hypotenuse function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::hypot.

Parameters
xfirst argument
ysecond argument
zthird argument
Returns
square root of sum of squares without internal over- or underflows
Exceptions
FE_INVALIDif x, y or z is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding of the final square root

Definition at line 3378 of file includes/half.hpp.

◆ ilogb [1/2]

int ilogb ( half  arg)
friend

Extract exponent.

See also: Documentation for std::ilogb.

Parameters
argnumber to query
Returns
floating-point exponent
Return values
FP_ILOGB0for zero
FP_ILOGBNANfor NaN
INT_MAXfor infinity
Exceptions
FE_INVALIDfor 0 or infinite values

Definition at line 4264 of file includes/half.hpp.

◆ ilogb [2/2]

int ilogb ( half  arg)
friend

Extract exponent.

See also: Documentation for std::ilogb.

Parameters
argnumber to query
Returns
floating-point exponent
Return values
FP_ILOGB0for zero
FP_ILOGBNANfor NaN
INT_MAXfor infinity
Exceptions
FE_INVALIDfor 0 or infinite values

Definition at line 4264 of file includes/half.hpp.

◆ isfinite [1/2]

HALF_CONSTEXPR bool isfinite ( half  arg)
friend

Check if finite number.

See also: Documentation for std::isfinite.

Parameters
argnumber to check
Return values
trueif neither infinity nor NaN
falseelse

Definition at line 4388 of file includes/half.hpp.

◆ isfinite [2/2]

HALF_CONSTEXPR bool isfinite ( half  arg)
friend

Check if finite number.

See also: Documentation for std::isfinite.

Parameters
argnumber to check
Return values
trueif neither infinity nor NaN
falseelse

Definition at line 4388 of file includes/half.hpp.

◆ isgreater [1/2]

HALF_CONSTEXPR bool isgreater ( half  x,
half  y 
)
friend

Quiet comparison for greater than.

See also: Documentation for std::isgreater.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater than y
falseelse

Definition at line 4429 of file includes/half.hpp.

◆ isgreater [2/2]

HALF_CONSTEXPR bool isgreater ( half  x,
half  y 
)
friend

Quiet comparison for greater than.

See also: Documentation for std::isgreater.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater than y
falseelse

Definition at line 4429 of file includes/half.hpp.

◆ isgreaterequal [1/2]

HALF_CONSTEXPR bool isgreaterequal ( half  x,
half  y 
)
friend

Quiet comparison for greater equal.

See also: Documentation for std::isgreaterequal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater equal y
falseelse

Definition at line 4440 of file includes/half.hpp.

◆ isgreaterequal [2/2]

HALF_CONSTEXPR bool isgreaterequal ( half  x,
half  y 
)
friend

Quiet comparison for greater equal.

See also: Documentation for std::isgreaterequal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater equal y
falseelse

Definition at line 4440 of file includes/half.hpp.

◆ isinf [1/2]

HALF_CONSTEXPR bool isinf ( half  arg)
friend

Check for infinity.

See also: Documentation for std::isinf.

Parameters
argnumber to check
Return values
truefor positive or negative infinity
falseelse

Definition at line 4395 of file includes/half.hpp.

◆ isinf [2/2]

HALF_CONSTEXPR bool isinf ( half  arg)
friend

Check for infinity.

See also: Documentation for std::isinf.

Parameters
argnumber to check
Return values
truefor positive or negative infinity
falseelse

Definition at line 4395 of file includes/half.hpp.

◆ isless [1/2]

HALF_CONSTEXPR bool isless ( half  x,
half  y 
)
friend

Quiet comparison for less than.

See also: Documentation for std::isless.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less than y
falseelse

Definition at line 4451 of file includes/half.hpp.

◆ isless [2/2]

HALF_CONSTEXPR bool isless ( half  x,
half  y 
)
friend

Quiet comparison for less than.

See also: Documentation for std::isless.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less than y
falseelse

Definition at line 4451 of file includes/half.hpp.

◆ islessequal [1/2]

HALF_CONSTEXPR bool islessequal ( half  x,
half  y 
)
friend

Quiet comparison for less equal.

See also: Documentation for std::islessequal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less equal y
falseelse

Definition at line 4462 of file includes/half.hpp.

◆ islessequal [2/2]

HALF_CONSTEXPR bool islessequal ( half  x,
half  y 
)
friend

Quiet comparison for less equal.

See also: Documentation for std::islessequal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less equal y
falseelse

Definition at line 4462 of file includes/half.hpp.

◆ islessgreater [1/2]

HALF_CONSTEXPR bool islessgreater ( half  x,
half  y 
)
friend

Quiet comarison for less or greater.

See also: Documentation for std::islessgreater.

Parameters
xfirst operand
ysecond operand
Return values
trueif either less or greater
falseelse

Definition at line 4473 of file includes/half.hpp.

◆ islessgreater [2/2]

HALF_CONSTEXPR bool islessgreater ( half  x,
half  y 
)
friend

Quiet comarison for less or greater.

See also: Documentation for std::islessgreater.

Parameters
xfirst operand
ysecond operand
Return values
trueif either less or greater
falseelse

Definition at line 4473 of file includes/half.hpp.

◆ isnan [1/2]

HALF_CONSTEXPR bool isnan ( half  arg)
friend

Check for NaN.

See also: Documentation for std::isnan.

Parameters
argnumber to check
Return values
truefor NaNs
falseelse

Definition at line 4402 of file includes/half.hpp.

◆ isnan [2/2]

HALF_CONSTEXPR bool isnan ( half  arg)
friend

Check for NaN.

See also: Documentation for std::isnan.

Parameters
argnumber to check
Return values
truefor NaNs
falseelse

Definition at line 4402 of file includes/half.hpp.

◆ isnormal [1/2]

HALF_CONSTEXPR bool isnormal ( half  arg)
friend

Check if normal number.

See also: Documentation for std::isnormal.

Parameters
argnumber to check
Return values
trueif normal number
falseif either subnormal, zero, infinity or NaN

Definition at line 4409 of file includes/half.hpp.

◆ isnormal [2/2]

HALF_CONSTEXPR bool isnormal ( half  arg)
friend

Check if normal number.

See also: Documentation for std::isnormal.

Parameters
argnumber to check
Return values
trueif normal number
falseif either subnormal, zero, infinity or NaN

Definition at line 4409 of file includes/half.hpp.

◆ lgamma [1/2]

half lgamma ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
natural logarith of gamma function for arg
Exceptions
FE_INVALIDfor signaling NaN
FE_DIVBYZEROfor 0 or negative integer arguments
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4030 of file includes/half.hpp.

◆ lgamma [2/2]

half lgamma ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
natural logarith of gamma function for arg
Exceptions
FE_INVALIDfor signaling NaN
FE_DIVBYZEROfor 0 or negative integer arguments
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4030 of file includes/half.hpp.

◆ log [1/2]

half log ( half  arg)
friend

Natural logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log.

Parameters
argfunction argument
Returns
logarithm of arg to base e
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3067 of file includes/half.hpp.

◆ log [2/2]

half log ( half  arg)
friend

Natural logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log.

Parameters
argfunction argument
Returns
logarithm of arg to base e
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3067 of file includes/half.hpp.

◆ log10 [1/2]

half log10 ( half  arg)
friend

Common logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log10.

Parameters
argfunction argument
Returns
logarithm of arg to base 10
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3095 of file includes/half.hpp.

◆ log10 [2/2]

half log10 ( half  arg)
friend

Common logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log10.

Parameters
argfunction argument
Returns
logarithm of arg to base 10
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3095 of file includes/half.hpp.

◆ log1p [1/2]

half log1p ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
logarithm of arg plus 1 to base e
Exceptions
FE_INVALIDfor signaling NaN or argument <-1
FE_DIVBYZEROfor -1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3173 of file includes/half.hpp.

◆ log1p [2/2]

half log1p ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
logarithm of arg plus 1 to base e
Exceptions
FE_INVALIDfor signaling NaN or argument <-1
FE_DIVBYZEROfor -1
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3173 of file includes/half.hpp.

◆ log2 [1/2]

half log2 ( half  arg)
friend

Binary logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log2.

Parameters
argfunction argument
Returns
logarithm of arg to base 2
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3130 of file includes/half.hpp.

◆ log2 [2/2]

half log2 ( half  arg)
friend

Binary logarithm.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::log2.

Parameters
argfunction argument
Returns
logarithm of arg to base 2
Exceptions
FE_INVALIDfor signaling NaN or negative argument
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3130 of file includes/half.hpp.

◆ logb [1/2]

half logb ( half  arg)
friend

Extract exponent.

See also: Documentation for std::logb.

Parameters
argnumber to query
Returns
floating-point exponent
Exceptions
FE_INVALIDfor signaling NaN
FE_DIVBYZEROfor 0

Definition at line 4282 of file includes/half.hpp.

◆ logb [2/2]

half logb ( half  arg)
friend

Extract exponent.

See also: Documentation for std::logb.

Parameters
argnumber to query
Returns
floating-point exponent
Exceptions
FE_INVALIDfor signaling NaN
FE_DIVBYZEROfor 0

Definition at line 4282 of file includes/half.hpp.

◆ lrint [1/2]

long lrint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::lrint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDif value is not representable as long
FE_INEXACTif value had to be rounded

Definition at line 4135 of file includes/half.hpp.

◆ lrint [2/2]

long lrint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::lrint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDif value is not representable as long
FE_INEXACTif value had to be rounded

Definition at line 4135 of file includes/half.hpp.

◆ lround [1/2]

long lround ( half  arg)
friend

Nearest integer.

See also: Documentation for std::lround.

Parameters
arghalf to round
Returns
nearest integer, rounded away from zero in half-way cases
Exceptions
FE_INVALIDif value is not representable as long

Definition at line 4119 of file includes/half.hpp.

◆ lround [2/2]

long lround ( half  arg)
friend

Nearest integer.

See also: Documentation for std::lround.

Parameters
arghalf to round
Returns
nearest integer, rounded away from zero in half-way cases
Exceptions
FE_INVALIDif value is not representable as long

Definition at line 4119 of file includes/half.hpp.

◆ modf [1/2]

half modf ( half  arg,
half *  iptr 
)
friend

Extract integer and fractional parts.

See also: Documentation for std::modf.

Parameters
argnumber to decompress
iptraddress to store integer part at
Returns
fractional part
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4236 of file includes/half.hpp.

◆ modf [2/2]

half modf ( half  arg,
half *  iptr 
)
friend

Extract integer and fractional parts.

See also: Documentation for std::modf.

Parameters
argnumber to decompress
iptraddress to store integer part at
Returns
fractional part
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4236 of file includes/half.hpp.

◆ nanh [1/2]

half nanh ( const char *  arg)
friend

Get NaN value.

See also: Documentation for std::nan.

Parameters
argstring code
Returns
quiet NaN

Definition at line 2932 of file includes/half.hpp.

◆ nanh [2/2]

half nanh ( const char *  arg)
friend

Get NaN value.

See also: Documentation for std::nan.

Parameters
argstring code
Returns
quiet NaN

Definition at line 2932 of file includes/half.hpp.

◆ nearbyint [1/2]

half nearbyint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::nearbyint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4142 of file includes/half.hpp.

◆ nearbyint [2/2]

half nearbyint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::nearbyint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDfor signaling NaN

Definition at line 4142 of file includes/half.hpp.

◆ nextafter [1/2]

half nextafter ( half  from,
half  to 
)
friend

Next representable value.

See also: Documentation for std::nextafter.

Parameters
fromvalue to compute next representable value for
todirection towards which to compute next value
Returns
next representable value after from in direction towards to
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOWfor infinite result from finite argument
FE_UNDERFLOWfor subnormal result

Definition at line 4308 of file includes/half.hpp.

◆ nextafter [2/2]

half nextafter ( half  from,
half  to 
)
friend

Next representable value.

See also: Documentation for std::nextafter.

Parameters
fromvalue to compute next representable value for
todirection towards which to compute next value
Returns
next representable value after from in direction towards to
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOWfor infinite result from finite argument
FE_UNDERFLOWfor subnormal result

Definition at line 4308 of file includes/half.hpp.

◆ nexttoward [1/2]

half nexttoward ( half  from,
long double  to 
)
friend

Next representable value.

See also: Documentation for std::nexttoward.

Parameters
fromvalue to compute next representable value for
todirection towards which to compute next value
Returns
next representable value after from in direction towards to
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOWfor infinite result from finite argument
FE_UNDERFLOWfor subnormal result

Definition at line 4335 of file includes/half.hpp.

◆ nexttoward [2/2]

half nexttoward ( half  from,
long double  to 
)
friend

Next representable value.

See also: Documentation for std::nexttoward.

Parameters
fromvalue to compute next representable value for
todirection towards which to compute next value
Returns
next representable value after from in direction towards to
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOWfor infinite result from finite argument
FE_UNDERFLOWfor subnormal result

Definition at line 4335 of file includes/half.hpp.

◆ operator!= [1/2]

HALF_CONSTEXPR_NOERR bool operator!= ( half  x,
half  y 
)
friend

Comparison for inequality.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands not equal
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2494 of file includes/half.hpp.

◆ operator!= [2/2]

HALF_CONSTEXPR_NOERR bool operator!= ( half  x,
half  y 
)
friend

Comparison for inequality.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands not equal
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2494 of file includes/half.hpp.

◆ operator* [1/2]

half operator* ( half  x,
half  y 
)
friend

Multiplication.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
product of half expressions
Exceptions
FE_INVALIDif multiplying 0 with infinity or if x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2635 of file includes/half.hpp.

◆ operator* [2/2]

half operator* ( half  x,
half  y 
)
friend

Multiplication.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
product of half expressions
Exceptions
FE_INVALIDif multiplying 0 with infinity or if x or y is signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2635 of file includes/half.hpp.

◆ operator+ [1/2]

half operator+ ( half  x,
half  y 
)
friend

Addition.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
sum of half expressions
Exceptions
FE_INVALIDif x and y are infinities with different signs or signaling NaNs
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2569 of file includes/half.hpp.

◆ operator+ [2/2]

half operator+ ( half  x,
half  y 
)
friend

Addition.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
sum of half expressions
Exceptions
FE_INVALIDif x and y are infinities with different signs or signaling NaNs
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2569 of file includes/half.hpp.

◆ operator- [1/4]

HALF_CONSTEXPR half operator- ( half  arg)
friend

Negation.

Parameters
argoperand
Returns
negated operand

Definition at line 2560 of file includes/half.hpp.

◆ operator- [2/4]

HALF_CONSTEXPR half operator- ( half  arg)
friend

Negation.

Parameters
argoperand
Returns
negated operand

Definition at line 2560 of file includes/half.hpp.

◆ operator- [3/4]

half operator- ( half  x,
half  y 
)
friend

Subtraction.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
difference of half expressions
Exceptions
FE_INVALIDif x and y are infinities with equal signs or signaling NaNs
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2619 of file includes/half.hpp.

◆ operator- [4/4]

half operator- ( half  x,
half  y 
)
friend

Subtraction.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
difference of half expressions
Exceptions
FE_INVALIDif x and y are infinities with equal signs or signaling NaNs
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2619 of file includes/half.hpp.

◆ operator/ [1/2]

half operator/ ( half  x,
half  y 
)
friend

Division.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
quotient of half expressions
Exceptions
FE_INVALIDif dividing 0s or infinities with each other or if x or y is signaling NaN
FE_DIVBYZEROif dividing finite value by 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2668 of file includes/half.hpp.

◆ operator/ [2/2]

half operator/ ( half  x,
half  y 
)
friend

Division.

This operation is exact to rounding for all rounding modes.

Parameters
xleft operand
yright operand
Returns
quotient of half expressions
Exceptions
FE_INVALIDif dividing 0s or infinities with each other or if x or y is signaling NaN
FE_DIVBYZEROif dividing finite value by 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2668 of file includes/half.hpp.

◆ operator< [1/2]

HALF_CONSTEXPR_NOERR bool operator< ( half  x,
half  y 
)
friend

Comparison for less than.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less than y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2505 of file includes/half.hpp.

◆ operator< [2/2]

HALF_CONSTEXPR_NOERR bool operator< ( half  x,
half  y 
)
friend

Comparison for less than.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less than y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2505 of file includes/half.hpp.

◆ operator<< [1/2]

template<typename charT , typename traits >
std::basic_ostream<charT,traits>& operator<< ( std::basic_ostream< charT, traits > &  out,
half  arg 
)
friend

Output operator.

This uses the built-in functionality for streaming out floating-point numbers.

Parameters
outoutput stream to write into
arghalf expression to write
Returns
reference to output stream

Definition at line 2707 of file includes/half.hpp.

◆ operator<< [2/2]

template<typename charT , typename traits >
std::basic_ostream<charT,traits>& operator<< ( std::basic_ostream< charT, traits > &  out,
half  arg 
)
friend

Output operator.

This uses the built-in functionality for streaming out floating-point numbers.

Parameters
outoutput stream to write into
arghalf expression to write
Returns
reference to output stream

Definition at line 2707 of file includes/half.hpp.

◆ operator<= [1/2]

HALF_CONSTEXPR_NOERR bool operator<= ( half  x,
half  y 
)
friend

Comparison for less equal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less equal y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2529 of file includes/half.hpp.

◆ operator<= [2/2]

HALF_CONSTEXPR_NOERR bool operator<= ( half  x,
half  y 
)
friend

Comparison for less equal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x less equal y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2529 of file includes/half.hpp.

◆ operator== [1/2]

HALF_CONSTEXPR_NOERR bool operator== ( half  x,
half  y 
)
friend

Comparison for equality.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands equal
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2483 of file includes/half.hpp.

◆ operator== [2/2]

HALF_CONSTEXPR_NOERR bool operator== ( half  x,
half  y 
)
friend

Comparison for equality.

Parameters
xfirst operand
ysecond operand
Return values
trueif operands equal
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2483 of file includes/half.hpp.

◆ operator> [1/2]

HALF_CONSTEXPR_NOERR bool operator> ( half  x,
half  y 
)
friend

Comparison for greater than.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater than y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2517 of file includes/half.hpp.

◆ operator> [2/2]

HALF_CONSTEXPR_NOERR bool operator> ( half  x,
half  y 
)
friend

Comparison for greater than.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater than y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2517 of file includes/half.hpp.

◆ operator>= [1/2]

HALF_CONSTEXPR_NOERR bool operator>= ( half  x,
half  y 
)
friend

Comparison for greater equal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater equal y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2541 of file includes/half.hpp.

◆ operator>= [2/2]

HALF_CONSTEXPR_NOERR bool operator>= ( half  x,
half  y 
)
friend

Comparison for greater equal.

Parameters
xfirst operand
ysecond operand
Return values
trueif x greater equal y
falseelse
Exceptions
FE_INVALIDif x or y is NaN

Definition at line 2541 of file includes/half.hpp.

◆ operator>> [1/2]

template<typename charT , typename traits >
std::basic_istream<charT,traits>& operator>> ( std::basic_istream< charT, traits > &  in,
half &  arg 
)
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.

Parameters
ininput stream to read from
arghalf to read into
Returns
reference to input stream
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2725 of file includes/half.hpp.

◆ operator>> [2/2]

template<typename charT , typename traits >
std::basic_istream<charT,traits>& operator>> ( std::basic_istream< charT, traits > &  in,
half &  arg 
)
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.

Parameters
ininput stream to read from
arghalf to read into
Returns
reference to input stream
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 2725 of file includes/half.hpp.

◆ pow [1/2]

half pow ( half  x,
half  y 
)
friend

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.

Parameters
xbase
yexponent
Returns
x raised to y
Exceptions
FE_INVALIDif x or y is signaling NaN or if x is finite an negative and y is finite and not integral
FE_DIVBYZEROif x is 0 and y is negative
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3444 of file includes/half.hpp.

◆ pow [2/2]

half pow ( half  x,
half  y 
)
friend

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.

Parameters
xbase
yexponent
Returns
x raised to y
Exceptions
FE_INVALIDif x or y is signaling NaN or if x is finite an negative and y is finite and not integral
FE_DIVBYZEROif x is 0 and y is negative
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3444 of file includes/half.hpp.

◆ remainder [1/2]

half remainder ( half  x,
half  y 
)
friend

Remainder of division.

See also: Documentation for std::remainder.

Parameters
xfirst operand
ysecond operand
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2781 of file includes/half.hpp.

◆ remainder [2/2]

half remainder ( half  x,
half  y 
)
friend

Remainder of division.

See also: Documentation for std::remainder.

Parameters
xfirst operand
ysecond operand
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2781 of file includes/half.hpp.

◆ remquo [1/2]

half remquo ( half  x,
half  y,
int *  quo 
)
friend

Remainder of division.

See also: Documentation for std::remquo.

Parameters
xfirst operand
ysecond operand
quoaddress to store some bits of quotient at
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2801 of file includes/half.hpp.

◆ remquo [2/2]

half remquo ( half  x,
half  y,
int *  quo 
)
friend

Remainder of division.

See also: Documentation for std::remquo.

Parameters
xfirst operand
ysecond operand
quoaddress to store some bits of quotient at
Returns
remainder of floating-point division.
Exceptions
FE_INVALIDif x is infinite or y is 0 or if x or y is signaling NaN

Definition at line 2801 of file includes/half.hpp.

◆ rint [1/2]

half rint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::rint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4127 of file includes/half.hpp.

◆ rint [2/2]

half rint ( half  arg)
friend

Nearest integer using half's internal rounding mode.

See also: Documentation for std::rint.

Parameters
arghalf expression to round
Returns
nearest integer using default rounding mode
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4127 of file includes/half.hpp.

◆ round [1/2]

half round ( half  arg)
friend

Nearest integer.

See also: Documentation for std::round.

Parameters
arghalf to round
Returns
nearest integer, rounded away from zero in half-way cases
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4112 of file includes/half.hpp.

◆ round [2/2]

half round ( half  arg)
friend

Nearest integer.

See also: Documentation for std::round.

Parameters
arghalf to round
Returns
nearest integer, rounded away from zero in half-way cases
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4112 of file includes/half.hpp.

◆ rsqrt [1/2]

half rsqrt ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
reciprocal of square root of arg
Exceptions
FE_INVALIDfor signaling NaN and negative arguments
FE_INEXACTaccording to rounding

Definition at line 3244 of file includes/half.hpp.

◆ rsqrt [2/2]

half rsqrt ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
reciprocal of square root of arg
Exceptions
FE_INVALIDfor signaling NaN and negative arguments
FE_INEXACTaccording to rounding

Definition at line 3244 of file includes/half.hpp.

◆ scalbln [1/2]

half scalbln ( half  arg,
long  exp 
)
friend

Multiply by power of two.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::scalbln.

Parameters
argnumber to modify
exppower of two to multiply with
Returns
arg multplied by 2 raised to exp
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4191 of file includes/half.hpp.

◆ scalbln [2/2]

half scalbln ( half  arg,
long  exp 
)
friend

Multiply by power of two.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::scalbln.

Parameters
argnumber to modify
exppower of two to multiply with
Returns
arg multplied by 2 raised to exp
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4191 of file includes/half.hpp.

◆ signbit [1/2]

HALF_CONSTEXPR bool signbit ( half  arg)
friend

Check sign.

See also: Documentation for std::signbit.

Parameters
argnumber to check
Return values
truefor negative number
falsefor positive number

Definition at line 4416 of file includes/half.hpp.

◆ signbit [2/2]

HALF_CONSTEXPR bool signbit ( half  arg)
friend

Check sign.

See also: Documentation for std::signbit.

Parameters
argnumber to check
Return values
truefor negative number
falsefor positive number

Definition at line 4416 of file includes/half.hpp.

◆ sin [1/2]

half sin ( half  arg)
friend

Sine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sin.

Parameters
argfunction argument
Returns
sine value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3573 of file includes/half.hpp.

◆ sin [2/2]

half sin ( half  arg)
friend

Sine function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sin.

Parameters
argfunction argument
Returns
sine value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3573 of file includes/half.hpp.

◆ sincos [1/2]

void sincos ( half  arg,
half *  sin,
half *  cos 
)
friend

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.

Parameters
argfunction argument
sinvariable to take sine of arg
cosvariable to take cosine of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3508 of file includes/half.hpp.

◆ sincos [2/2]

void sincos ( half  arg,
half *  sin,
half *  cos 
)
friend

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.

Parameters
argfunction argument
sinvariable to take sine of arg
cosvariable to take cosine of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3508 of file includes/half.hpp.

◆ sinh [1/2]

half sinh ( half  arg)
friend

Hyperbolic sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sinh.

Parameters
argfunction argument
Returns
hyperbolic sine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3810 of file includes/half.hpp.

◆ sinh [2/2]

half sinh ( half  arg)
friend

Hyperbolic sine.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sinh.

Parameters
argfunction argument
Returns
hyperbolic sine value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3810 of file includes/half.hpp.

◆ sqrt [1/2]

half sqrt ( half  arg)
friend

Square root.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sqrt.

Parameters
argfunction argument
Returns
square root of arg
Exceptions
FE_INVALIDfor signaling NaN and negative arguments
FE_INEXACTaccording to rounding

Definition at line 3223 of file includes/half.hpp.

◆ sqrt [2/2]

half sqrt ( half  arg)
friend

Square root.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::sqrt.

Parameters
argfunction argument
Returns
square root of arg
Exceptions
FE_INVALIDfor signaling NaN and negative arguments
FE_INEXACTaccording to rounding

Definition at line 3223 of file includes/half.hpp.

◆ std::numeric_limits< half >

friend class std::numeric_limits< half >
friend

Definition at line 2276 of file includes/half.hpp.

◆ tan [1/2]

half tan ( half  arg)
friend

Tangent function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::tan.

Parameters
argfunction argument
Returns
tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3634 of file includes/half.hpp.

◆ tan [2/2]

half tan ( half  arg)
friend

Tangent function.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::tan.

Parameters
argfunction argument
Returns
tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN or infinity
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3634 of file includes/half.hpp.

◆ tanh [1/2]

half tanh ( half  arg)
friend

Hyperbolic tangent.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::tanh.

Parameters
argfunction argument
Returns
hyperbolic tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3865 of file includes/half.hpp.

◆ tanh [2/2]

half tanh ( half  arg)
friend

Hyperbolic tangent.

This function is exact to rounding for all rounding modes.

See also: Documentation for std::tanh.

Parameters
argfunction argument
Returns
hyperbolic tangent value of arg
Exceptions
FE_INVALIDfor signaling NaN
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 3865 of file includes/half.hpp.

◆ tgamma [1/2]

half tgamma ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
gamma function value of arg
Exceptions
FE_INVALIDfor signaling NaN, negative infinity or negative integer arguments
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4055 of file includes/half.hpp.

◆ tgamma [2/2]

half tgamma ( half  arg)
friend

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.

Parameters
argfunction argument
Returns
gamma function value of arg
Exceptions
FE_INVALIDfor signaling NaN, negative infinity or negative integer arguments
FE_DIVBYZEROfor 0
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 4055 of file includes/half.hpp.

◆ trunc [1/2]

half trunc ( half  arg)
friend

Nearest integer not greater in magnitude than half value.

See also: Documentation for std::trunc.

Parameters
arghalf to round
Returns
nearest integer not greater in magnitude than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4104 of file includes/half.hpp.

◆ trunc [2/2]

half trunc ( half  arg)
friend

Nearest integer not greater in magnitude than half value.

See also: Documentation for std::trunc.

Parameters
arghalf to round
Returns
nearest integer not greater in magnitude than arg
Exceptions
FE_INVALIDfor signaling NaN
FE_INEXACTif value had to be rounded

Definition at line 4104 of file includes/half.hpp.


The documentation for this class was generated from the following file: