half  1.12
IEEE 754-based half-precision floating point library
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
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 (of course only if C++11 user-defined literals are supported and enabled):

using namespace half_float::literal;

Function Documentation

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

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)