mirror of
https://github.com/louis-langholtz/realnumb.git
synced 2026-10-21 19:23:48 +00:00
Pull mirror of https://github.com/louis-langholtz/realnumb
- C++ 92.6%
- CMake 7.4%
| .github/workflows | ||
| build/realnumb.xcodeproj | ||
| library | ||
| unittest | ||
| .clang-tidy | ||
| .gitignore | ||
| CMakeLists.txt | ||
| LICENSE | ||
| README.md | ||
realnumb
A constexpr enhanced, real numbers, C++ library with support for fixed point types satisfying the LiteralType named requirement.
Why?
Why yet another fixed-point data type and math library?
Reasons:
- For a
constexprenhanced fixed-point type. - For
constexprenhancedcmathfunctions at least for the fixed-point type. - For that fixed-point type to satisfy the
LiteralTypenamed requirement. - To get this code out from another project it had been in (PlayRho), and in to its own project.
- Having a project whose consumption by another project of mine could be more readily tested.
Caveats
This is experimental code that's a work in progress.
Usage
Component
To use this within your own project...
CMake FetchContent Usage
Add the following to your CMake configuration where you replace your_target with your project's target name:
include(FetchContent)
FetchContent_Declare(
realnumb
GIT_REPOSITORY https://github.com/louis-langholtz/realnumb
GIT_TAG main # Hash or tag or branch name
)
FetchContent_MakeAvailable(realnumb)
target_link_libraries(your_target realnumb)
Stand Alone
Like for development...
Via CMake
Configure and build:
cmake -S realnumb -B realnumb_build -DREALNUMB_BUILD_UNITTEST=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DREALNUMB_INSTALL=ON
cmake --build realnumb_build --config Release
Then, for a local install:
cmake --install realnumb_build --prefix realnumb_install
Related
- Fixed point arithmetic on WikiPedia.
- PlayRho issue No external fixed-point implementation supported.
- Compositional Numeric Library, a C++ library of fixed-precision numeric classes.
- libfixmath archived at code.google.com and libfixmath at github. Neither of these appear to have
constexprsupport, nor support for anything but Q16.16 format, nor active maintenance.