AbitTheGray / FixedPointNumbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixed Point Numbers

Github Actions

Library to allow working with fixed-point numbers.

Features

  • Fixed-point numbers up to 64-bit total
  • Mathematical operations and functions
    • Some implemented using fallback cast to double
    • constexpr where possible
  • Typedefs for fixed-point GLM vectors and matrices

Example

#include <iostream>
#include "fixed.hpp"
#include "fixed_math.hpp"

int main()
{
    fpn::fixed8_8 value = 0;
    value += 3.0;
    value *= 2;

    fpn::fixed8_8 sine = fpn::sin(value);
    std::cout << sine << std::endl;
}

About


Languages

Language:C++ 99.3%Language:CMake 0.7%