literal Namespace Reference

literal Namespace Reference#

half: half_float::literal Namespace Reference
half_float::literal Namespace Reference

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

Functions

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

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.
Definition: half.hpp:1076
Library-defined half-precision literals.
Definition: half.hpp:274

Function Documentation

◆ operator""_h()

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

Half literal.

While this returns an actual half-precision value, half literals can unfortunately not be constant expressions due to rather involved conversions.

Parameters
valueliteral value
Returns
half with given value (if representable)

Definition at line 1199 of file half.hpp.