Skip to content

Commit 7d64b7f

Browse files
committed
Update readme file
1 parent be9c8f5 commit 7d64b7f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ class long_int_t; // signed integer
2020
```
2121
where native_t may be one of base unsigned type and size must by power of two.
2222
## Implementation
23-
* [long_int.h](include/slimcpplib/long_int.h) - signed long integer class
23+
* [long_int.h](include/slimcpplib/long_int.h) - signed long integer class (**Can be completely removed if not used**)
2424
* [long_uint.h](include/slimcpplib/long_uint.h) - unsigned long integer class
2525
* [long_math.h](include/slimcpplib/long_math.h) - cross-platform helper classes and functions
26-
* [long_math_gcc.h](include/slimcpplib/long_math_gcc.h) - GCC, CLANG helper classes and functions (Could be completely removed if irrelevant)
27-
* [long_math_msvc.h](include/slimcpplib/long_math_msvc.h) - MSVC helper classes and functions (Could be completely removed if irrelevant)
26+
* [long_math_long.h](include/slimcpplib/long_math_long.h) - cross-platform helper classes and functions (long_uint_t/long_int_t specializations)
27+
* [long_math_gcc.h](include/slimcpplib/long_math_gcc.h) - GCC, CLANG helper classes and functions (**Can be completely removed if irrelevant**)
28+
* [long_math_msvc.h](include/slimcpplib/long_math_msvc.h) - MSVC helper classes and functions (**Can be completely removed if irrelevant**)
29+
* [long_io.h](include/slimcpplib/long_io.h) - standard stream input/output (**Can be completely removed if not used**)
2830
## Integration
2931
The library implements four predefined types: uint128_t, uint256_t, int128_t, int256_t. You can use them in your project by include code below:
3032
```c++
@@ -77,6 +79,12 @@ The library implements the muldiv method for faster calculation of the following
7779
template<typename type_t>
7880
constexpr type_t muldiv(const type_t& value, const type_t& multiplier, const type_t& divider) noexcept;
7981
```
82+
## Standard stream input/output
83+
```c++
84+
std::cout << std::oct << 338770000845734292534325025077361652240_ui128 << "\n"; // output value in octal form
85+
std::cout << std::dec << 03766713523035452062041773345651416625031020_ui128 << " \n"; // output value in decimal form
86+
std::cout << std::hex << 0xfedcba9876543210fedcba9876543210_ui128 << "\n"; // output value in hexadecimal form
87+
```
8088
## Limitations
8189
* 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.
8290
* 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)