Struct f31

Struct Documentation

struct f31

Class for 1.31 unsigned floating-point computation.

Public Functions

inline HALF_CONSTEXPR f31(uint32 mant, int e)

Constructor.

Parameters:
  • mant – mantissa as 1.31

  • e – exponent

inline f31(unsigned int abs)

Constructor.

Parameters:

abs – unsigned half-precision value

Public Members

uint32 m

mantissa as 1.31.

int exp

exponent.

Friends

inline friend f31 operator+(f31 a, f31 b)

Addition operator.

Parameters:
  • a – first operand

  • b – second operand

Returns:

a + b

inline friend f31 operator-(f31 a, f31 b)

Subtraction operator.

Parameters:
  • a – first operand

  • b – second operand

Returns:

a - b

inline friend f31 operator*(f31 a, f31 b)

Multiplication operator.

Parameters:
  • a – first operand

  • b – second operand

Returns:

a * b

inline friend f31 operator/(f31 a, f31 b)

Division operator.

Parameters:
  • a – first operand

  • b – second operand

Returns:

a / b