arena allocator + incremental garbage collector
  • C++ 98.4%
  • CMake 1.6%
Find a file
2024-04-18 17:08:04 -04:00
cmake xo-ratio: + .to_str() method using xo-flatstring 2024-04-18 17:06:29 -04:00
example xo-ratio: expand example ex1.cpp 2024-04-18 17:07:50 -04:00
include/xo/ratio xo-ratio: + .to_str() method using xo-flatstring 2024-04-18 17:06:29 -04:00
utest xo-ratio: + unit test 2024-04-18 17:07:01 -04:00
.gitignore xo-ratio: + .gitignore 2024-04-17 21:23:47 -04:00
CMakeLists.txt xo-ratio: build: + utest dir (!) 2024-04-18 17:08:04 -04:00
LICENSE xo-ratio: initial commit 2024-04-17 21:23:20 -04:00
README.md xo-ratio: initial commit 2024-04-17 21:23:20 -04:00

ratio library

Header-only, constexpr library providing exact representation for rational numbers.

Relative to std::ratio:

  1. Uses constexpr instead of creating new types. This means it can be used seamlessly at runtime.
  2. Supports a few more arithmetic operations, for example exponentiation to integer powers.
  3. Provides concept support (with c++20)
  4. Requires modern (c++17) support to achieve this

Getting Started

install dependencies

build + install

$ cd xo-ratio
$ PREFIX=/usr/local # for example
$ BUILDDIR=.build   # for example
$ make ${BUILDDIR}
$ cmake -DCMAKE_PREFIX_PATH=${PREFIX} -B ${BUILDDIR}