Skip to content

Commit 1516240

Browse files
authored
Update README.md
1 parent e8c0494 commit 1516240

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SLIMCPP
2-
# Simple long integer math libtary for C++
3-
This library implements long integers that exceed maximum size of native type supported by a specific compiler by 2-4 times. In some cases, it is necessary to temporarily perform calculations with precision exceeding the maximum supported size of integers, and then return the result to its native size again.
2+
# Simple long integer math library for C++
3+
SLIMCPP is C++ header-only library that implements long integers that exceed maximum size of native type supported by a specific compiler by 2-4 times. All classes, methods and functions were not created or designed to work with huge numbers, for which there are specialized mathematical libraries. In some cases, it is necessary to temporarily perform calculations with precision exceeding the maximum supported size of integers, and then return the result to its native size again. The conditions are ideal for SLIMCPP.
44
The main features:
55
* easy to use: the library is header-only
66
* small: consists of few header files, there is no dependencies
@@ -28,9 +28,9 @@ where native_t may be one of base unsigned type and size must by power of two.
2828
## Integration
2929
The library implements four predefined types: uint128_t, uint256_t, int128_t, int256_t. You can use them in you project by include code below:
3030
```c++
31-
#include <slimcpplib/long_uint.h>
31+
#include <slimcpplib/long_int.h> // Include all integers support
3232
// or
33-
#include <slimcpplib/long_int.h>
33+
#include <slimcpplib/long_uint.h> // Include only unsigned integers support
3434

3535
namespace your_namespace
3636
{
@@ -70,11 +70,13 @@ const uint128_t u = true; // construction from boolean value
7070
` ==, !=, <, <=, >, >=, <<=, <<, >>=, >>, +=, +, ++, -=, -, --, *=, *, /=, /, %=, %, ~, &=, &, |=, |, ^=, ^`
7171

7272
* long_int_t type supports following operators:
73-
`==, !=, <, <=, >, >=, <<=, <<, >>=, >>, +=, +, ++, -=, -, --, *=, *, /=, /, %=, %`
73+
`==, !=, <, <=, >, >=, +=, +, ++, -=, -, --, *=, *, /=, /, %=, %`
7474
## MulDiv
7575
The library implements the muldiv method for faster calculation of the following expressions: (a * b / c). It can be used with signed and unsigned integers.
7676
```c++
7777
template<typename type_t>
7878
constexpr type_t muldiv(const type_t& value, const type_t& multiplier, const type_t& divider) noexcept;
7979
```
8080
## Limitations
81+
* Although all methods and functions are defined using the constexpr qualifier, due to the limitations of C++ 17, working completely at compile time is only possible for code without instrinsics, since there is no implementation of [std::is_constant_evaluated()](https://en.cppreference.com/w/cpp/types/is_constant_evaluated) in the standard before C++ 20.
82+
* The design of long integers tries to completely repeat the behavior of native integers, but still differs. For example, the propagation of integer types always occurs from a signed integer to an unsigned integer, and an implicit conversion from a larger integer to a smaller integer does not cause a warning, but a compilation error.

0 commit comments

Comments
 (0)