sparrow 1.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
half_float::literal Namespace Reference

Library-defined half-precision literals. More...

Functions

half operator""_h (long double value)
 Half literal.
 

Detailed Description

Library-defined half-precision literals.

Import this namespace to enable half-precision floating-point literals:

using namespace half_float::literal;
Half-precision floating-point type.
Library-defined half-precision literals.

Function Documentation

◆ operator""_h()

half half_float::literal::operator""_h ( long double value)
inline

Half literal.

While this returns a properly rounded half-precision value, half literals can unfortunately not be constant expressions due to rather involved conversions. So don't expect this to be a literal literal without involving conversion operations at runtime. It is a convenience feature, not a performance optimization.

Parameters
valueliteral value
Returns
half with of given value (possibly rounded)
Exceptions
FE_OVERFLOW,...UNDERFLOW,...INEXACTaccording to rounding

Definition at line 1910 of file float16_t.hpp.

Here is the call graph for this function: