8 Commits

Author SHA1 Message Date
EnilPajic
5baf5d3dae
Fixed potential bug with -MINIMUM_VALUE
Original code had something like `N < 0 ? -N : N` which could fail if `N` has minimum value of appropriate type. For example, in original code this could fail:
```cpp
const long long int LL_MIN = std::numeric_limits<long long int>::min(); //probably: -9223372036854775808
static const char *number = to_string<LL_MIN, 10>;
```

Also note that this code relies on "modulo on negative first operands" which was implementation defined in C++03 and before, but with C++11 and later it is defined by standard (see `ISO14882:2011(e)`), and this code anyway targets C++17 so we're safe here.
2020-06-26 21:25:39 +02:00
2be778931d
Added explanation of code 2020-06-26 13:42:41 -04:00
5510e86a96
Described new changes 2020-06-26 13:14:54 -04:00
796eb3e7ee
Remove redundant length calculation; expand base support to 36 2020-06-26 13:12:14 -04:00
aa85b760a8
Added compiler explorer link 2020-06-26 11:16:59 -04:00
0f38f29202
Update README.md 2020-06-26 11:13:25 -04:00
a436ba6867
Create to_string.hpp 2020-06-26 11:02:37 -04:00
2cd6a7d877
Initial commit 2020-06-26 10:47:36 -04:00