Loading...
Searching...
No Matches
Math::half Struct Reference

half-precision floating point type More...

`#include <src/math/half.h>`

## Public Member Functions

| half ()
| Default constructor.
| half (const half &other)
| Copy constructor.
half & | operator= (const half &other)
| Copy operator.
| half (int value)
| Conversion constructor from int.
| half (float value)
| Conversion constructor from float.
| operator int () const
| Conversion operator to int.
| operator float () const
| Conversion operator to float.

## Public Attributes

uint16_t | bits
| 16-bit binary representation of half-float

## Detailed Description

half-precision floating point type

Represents a half-precision floating point value. Contains the required methods for converting to and from ints and floats.

This type is for storage only. Conversion is expensive and should be avoided if possible.

## Constructor & Destructor Documentation

## half() [1/4]

Math::half::half | ( |  | ) |

inline

Default constructor.

## half() [2/4]

Math::half::half | ( | const half & | other | ) |

inline

Copy constructor.

## half() [3/4]

Math::half::half | ( | int | value | ) |

inline explicit

Conversion constructor from int.

## half() [4/4]

Math::half::half | ( | float | value | ) |

inline explicit

Conversion constructor from float.

## Member Function Documentation

## operator=()

half & Math::half::operator= | ( | const half & | other | ) |

inline

Copy operator.

## operator int()

Math::half::operator int | ( |  | ) | const

inline explicit

Conversion operator to int.

## operator float()

Math::half::operator float | ( |  | ) | const

inline explicit

Conversion operator to float.

## Member Data Documentation

## bits

uint16_t Math::half::bits

16-bit binary representation of half-float

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

- src/math/half.h