clan::HalfFloat Class Reference - ClanLib SDK
Description: clan::HalfFloat Class Reference

Public Member Functions | Static Public Member Functions | List of all members
clan::HalfFloat Class Reference
clanCore Math

`#include <half_float.h>`

## Public Member Functions
| HalfFloat ()
| HalfFloat (const HalfFloat &other)=default
| HalfFloat (float v)
HalfFloat & | from_float (float v)
| operator float () const
HalfFloat & | operator= (const float v)
HalfFloat & | operator= (const HalfFloat &other)=default
float | to_float () const

## Static Public Member Functions
static unsigned short | float_to_half (float float_value)
static unsigned short | float_to_half_simple (float float_value)
| Only works for 'normal' half-float values.
static float | half_to_float (unsigned short hf)
static float | half_to_float_simple (unsigned short hf)
| Only works for 'normal' half-float values.

## Constructor & Destructor Documentation

## ◆ HalfFloat() [1/3]

clan::HalfFloat::HalfFloat | ( |  | ) |
| inline

Referenced by HalfFloat(), from_float(), operator=(), and operator=().

## ◆ HalfFloat() [2/3]

clan::HalfFloat::HalfFloat | ( | const HalfFloat & | other | ) |
| default

References HalfFloat().

## ◆ HalfFloat() [3/3]

clan::HalfFloat::HalfFloat | ( | float | v | ) |
| inline

References float_to_half(), and clan::v.

## Member Function Documentation

## ◆ float_to_half()

unsigned short clan::HalfFloat::float_to_half | ( | float | float_value | ) |
| inlinestatic

References clan::f.

Referenced by HalfFloat(), and from_float().

## ◆ float_to_half_simple()

unsigned short clan::HalfFloat::float_to_half_simple | ( | float | float_value | ) |
| inlinestatic

Only works for 'normal' half-float values.

References clan::f.

## ◆ from_float()

HalfFloat & clan::HalfFloat::from_float | ( | float | v | ) |
| inline

References HalfFloat(), float_to_half(), and clan::v.

Referenced by operator=().

## ◆ half_to_float()

float clan::HalfFloat::half_to_float | ( | unsigned short | hf | ) |
| inlinestatic

Referenced by to_float().

## ◆ half_to_float_simple()

float clan::HalfFloat::half_to_float_simple | ( | unsigned short | hf | ) |
| inlinestatic

Only works for 'normal' half-float values.

## ◆ operator float()

clan::HalfFloat::operator float | ( |  | ) | const
| inline

References to_float().

## ◆ operator=() [1/2]

HalfFloat & clan::HalfFloat::operator= | ( | const float | v | ) |
| inline

References HalfFloat(), from_float(), and clan::v.

## ◆ operator=() [2/2]

HalfFloat & clan::HalfFloat::operator= | ( | const HalfFloat & | other | ) |
| default

References HalfFloat().

## ◆ to_float()

float clan::HalfFloat::to_float | ( |  | ) | const
| inline

References half_to_float().

Referenced by operator float().

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

- half_float.h