Skip to content

Commit 3ac7857

Browse files
authored
Update README.md
1 parent 4f7b5f0 commit 3ac7857

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

README.md

+25-23
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg) ![CMake](https://github.com/arturbac/fixed_math/workflows/CMake/badge.svg) ![language](https://img.shields.io/badge/language-C%2B%2B17-blue.svg)
1+
![MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg) ![CMake](https://github.com/arturbac/fixed_math/workflows/CMake/badge.svg) ![language](https://img.shields.io/badge/language-C%2B%2B23-blue.svg)
22

33
# FixedMath
44

55
A comprehensive fixed-point math library written in C++23 and C++17, designed for high precision and efficiency.
66

77
## Major changes 12.08.2024
8-
- master contains version 2.x rewritten in c++23 - under development
8+
- master contains version 2.x rewritten in c++23
99
- branch 1.x contains stable c++17 which will be still maintained for compatibility and bugfixes
1010

1111
## Features
1212

13-
- **Modern C++ Standards**: Requires a minimum of C++17, leveraging modern language features for optimal performance and reliability.
13+
- **Modern C++ Standards**: Requires a minimum of C++23, (branch 1.x c++17) leveraging modern language features for optimal performance and reliability.
1414
- **Strongly Typed Fixed-Point Arithmetic**: Utilizes a 48.16 fixed-point arithmetic model, ensuring type safety with explicit conversions and operations. The `fixed_t` type is robust against unintentional type conversions, fostering code correctness.
1515
- **Implicit Type Promotion**: Supports implicit promotion of all arithmetic types (excluding `double`) to `fixed_t` in basic arithmetic operations, enhancing ease of use without sacrificing precision.
1616
- **Double Precision Compatibility**: Interactions between `fixed_t` and `double` types automatically yield a `double` result type. Arithmetic operations involving `double` are seamlessly elevated to double precision, ensuring accuracy for critical calculations.
17-
- **Compile-Time Evaluation**: The entire codebase, including trigonometric functions, is `constexpr`, enabling compile-time evaluations where applicable. This feature significantly reduces runtime overhead and allows for constant expressions.\[1\]\[2\]
17+
- **Compile-Time Evaluation**: The entire codebase, including trigonometric functions, is `constexpr`, enabling compile-time evaluations where applicable. This feature significantly reduces runtime overhead and allows for constant expressions.\[1\]
1818
- **Header-Only Library**: As a fully header-only library with extensive use of `constexpr`, FixedMath simplifies integration into projects. Explore the API interface and implementation details: [API Reference](https://arturbac.github.io/fixed_math/) | [Implementation](https://github.com/arturbac/fixed_math/blob/master/fixed_lib/include/fixedmath/math.h).
1919
- **Compile-Time Unit Testing**: Offers a robust suite of compile-time unit tests, streamlining test-driven development and ensuring library correctness. Dive into the unit tests: [Compile-Time Unit Tests](https://github.com/arturbac/fixed_math/tree/master/fixed_lib/include/fixedmath/unittests).
2020

2121
FixedMath is committed to delivering precision, efficiency, and ease of use, making it an ideal choice for projects requiring fixed-point arithmetic in a modern C++ environment.
2222

23-
\[1\] Starting with C++20, the `sqrt` function is always available as `constexpr`, utilizing the Abacus algorithm for constant evaluation, alongside the standard `std::sqrt` for runtime execution.
24-
25-
\[2\] In C++17, `std::sqrt` is used by default, leveraging the CPU's hardware support for square root calculations, which allows for inline optimizations. For compile-time evaluations, the Abacus algorithm can be enabled by defining `FIXEDMATH_ENABLE_SQRT_ABACUS_ALGO`. Note that while the Abacus algorithm supports `constexpr` usage, it is typically slower than the CPU-optimized implementation.
23+
\[1\] The `sqrt` function is always available as `constexpr`, utilizing the Abacus algorithm for constant evaluation, alongside the standard `std::sqrt` for runtime execution. On windows msvc toolset (not clang-cl) still is not fully compatibile with c++23 and still has nonsense compiletime evaluation errors, [for example I had to split consteval function into constant](https://github.com/arturbac/fixed_math/blob/4f7b5f00b60dce007305d44ed4d2edb4ea98eb65/unit_tests/addition_ut.cc#L8) but this change does not has any sense.
2624

2725
### Performance Comparisons of Code Version 0.9.1
2826

@@ -69,7 +67,7 @@ For projects utilizing CPM (CMake Package Manager) for dependency management, yo
6967
CPMAddPackage(
7068
NAME fixed_math
7169
GITHUB_REPOSITORY arturbac/fixed_math
72-
GIT_TAG v1.0.0
70+
GIT_TAG v2.0.0
7371
)
7472
7573
find_package(fixed_math REQUIRED)
@@ -84,28 +82,32 @@ The following compilers are confirmed to compile the project in branches
8482

8583
### version 2.x with C++23 standard, master development branch.
8684
- Clang version 18.0.1 with llvm-libcxx on Gentoo x86-64
87-
- Clang version 13.0.0 with gcc-libstdc++ 14.1.1 on Gentoo x86-64
88-
- GCC 14.1.1_p20240720 p4
89-
- MSVC - under develoment
85+
- Clang version 18.0.1 with gcc-libstdc++ 14.1.1 on Gentoo x86-64
86+
- Clang version 18 on ubuntu-24.04
87+
- GCC 14.1.1_p20240720 p4 on Gentoo x86-64
88+
- GCC 14.0.1 on ubuntu-24.04
89+
- MSVC ClanCL-toolset 17.0.3 from MSVC 19.40.33813.0
90+
- MSVC toolset 19.40.33813.0
9091

9192

9293
### version 1.x with C++17 standard on stable 1.x branch
93-
94-
- Clang version 17.0.6 with llvm-libcxx on Gentoo x86-64
95-
- Clang version 13.0.0 with llvm-libcxx on Gentoo x86-64
96-
- Clang version 13.0.0 with gcc-libstdc++ 11.2.1 on Gentoo x86-64
97-
- Clang version 12.0.1 with llvm-libcxx on FreeBSD 13 x86-64
98-
- Clang version 11.0.1 with gcc-libstdc++ 10.2.0 on Gentoo Linux x86-64 and aarch64
99-
- Clang version 11.0.1 with llvm-libcxx on x86-64
100-
- Clang version 10.0.1 with llvm-libcxx on FreeBSD 13 x86-64
101-
- GCC version 13.2.1_p20240210 p13 on Gentoo x86-64
102-
- GCC version 12.3.1_p20240209 p2 on Gentoo x86-64
103-
- GCC version 11.2.1 20211127 on Gentoo x86-64
94+
- Clang 18.0.1 with llvm-libcxx on Gentoo x86-64
95+
- Clang 17.0.6 with llvm-libcxx on Gentoo x86-64
96+
- Clang 13.0.0 with llvm-libcxx on Gentoo x86-64
97+
- Clang 13.0.0 with gcc-libstdc++ 11.2.1 on Gentoo x86-64
98+
- Clang 12.0.1 with llvm-libcxx on FreeBSD 13 x86-64
99+
- Clang 11.0.1 with gcc-libstdc++ 10.2.0 on Gentoo Linux x86-64 and aarch64
100+
- Clang 11.0.1 with llvm-libcxx on x86-64
101+
- Clang 10.0.1 with llvm-libcxx on FreeBSD 13 x86-64
102+
- GCC 14.1.1_p20240720 p4 on Gentoo x86-64
103+
- GCC 13.2.1_p20240210 p13 on Gentoo x86-64
104+
- GCC 12.3.1_p20240209 p2 on Gentoo x86-64
105+
- GCC 11.2.1 20211127 on Gentoo x86-64
104106
- GCC 10.2.0 on x86-64 on Gentoo x86-64
105107
- GCC 9.4.0 on Gentoo x86-64
106108
- MSVC 19 (Visual Studio 2019) support
107109

108-
If you encounter any issues with a C++17 compatible compiler, please report it by submitting an issue. The standard template library (STL) compatibility is expected to be consistent across these compilers:
110+
If you encounter any issues, please report it by submitting an issue.
109111

110112
## Usage
111113

0 commit comments

Comments
 (0)