Bruno BELANYI
f4f620436c
abacus: bignum: add sqrt
2021-08-22 13:58:43 +02:00
Bruno BELANYI
d03058e410
abacus: bignum: add note about div_mod performance
2021-08-22 13:57:29 +02:00
Bruno BELANYI
cfa19a60ba
abacus: bignum: trim zeros after a subtraction
...
This way we keep a canonicalized version of the result.
2021-08-22 13:55:12 +02:00
Bruno BELANYI
3397bf4310
abacus: bignum: fix order comparisons
...
This is a pretty big oversight...
2021-08-22 13:55:12 +02:00
Bruno BELANYI
5bc3963317
abacus: bignum: add exponentiation
2021-08-22 13:55:12 +02:00
Bruno BELANYI
0436d2e513
abacus: bignum: factorize trim of leading zeros
2021-08-22 13:55:12 +02:00
Bruno BELANYI
4e3d53ecd4
abacus: bignum: add division & modulo
...
Like the C language, the `%` operator is rather the remainder, such that
`(a/b)*b + (a%b) = a`.
I still call it modulo though...
2021-08-22 13:55:12 +02:00
Bruno BELANYI
7cd0664e60
abacus: bignum: fix carry bug in addition
2021-08-21 01:32:18 +02:00
Bruno BELANYI
c23500607f
clang-format: format operators more aesthetically
2021-08-21 01:32:18 +02:00
Bruno BELANYI
44bb20e390
abacus: bignum: remove magic number regarding base
2021-08-21 01:32:12 +02:00
Bruno BELANYI
2489ce19b2
abacus: bignum: put sign checks in helper methods
...
Make them public because they can be useful in consumers of the library.
2021-08-21 01:31:49 +02:00
Bruno BELANYI
4a4b9f361c
abacus: bignum: add multiplication
2021-08-21 01:31:48 +02:00
Bruno BELANYI
eb47889eef
gdbinit: register pretty-printers automatically
2021-08-21 01:31:48 +02:00
Bruno BELANYI
dcf896651d
utils: gdb: add BigNum pretty printer
2021-08-21 01:31:48 +02:00
Bruno BELANYI
d40c109fb7
abacus: bignum: add input operator
2021-08-21 01:31:48 +02:00
Bruno BELANYI
fe01661613
abacus: bignum: add addition & substraction
2021-08-21 01:31:39 +02:00
Bruno BELANYI
d083ede78c
abacus: bignum: factorize lexicographical compare
...
I want to make use of it for substraction.
2021-08-20 22:20:45 +02:00
Bruno BELANYI
6f7e1102db
abacus: bignum: add default constructor
2021-08-20 22:20:45 +02:00
Bruno BELANYI
ad5092ea8d
abacus: bignum: add output operator
2021-08-20 22:20:45 +02:00
Bruno BELANYI
0a5fb471e4
abacus: bignum: add unary operators
2021-08-20 22:20:45 +02:00
Bruno BELANYI
7c1b3d302e
tests: unit: add bignum tests
2021-08-20 22:20:45 +02:00
Bruno BELANYI
2600eb2ba7
abacus: bignum: add order comparisons
2021-08-20 22:20:45 +02:00
Bruno BELANYI
17bd51d197
abacus: bignum: add equality comparisons
2021-08-20 22:20:45 +02:00
Bruno BELANYI
2cff603a48
abacus: bignum: add is_canonicalized predicate
...
Useful when debugging.
2021-08-20 22:20:45 +02:00
Bruno BELANYI
12c8b6b114
abacus: add initial bignum library
2021-08-20 22:20:45 +02:00
Bruno BELANYI
ff35faa705
abacus: add parse library
...
Would need some improvements, such as by using the C++ Flex scanner
interface.
It will also need to start using the BigNum once it has been
implemented.
2021-08-20 22:20:45 +02:00
Bruno BELANYI
42100fe98d
clang-format: do not indent access modifiers
2021-08-20 22:20:45 +02:00
Bruno BELANYI
1896ee5fb5
git: ignore generated files
2021-08-20 22:20:45 +02:00
Bruno BELANYI
d97eb0473b
nix: add direnv integration
2021-08-20 22:20:45 +02:00
Bruno BELANYI
14b8c4460c
clang-format: init config
2021-08-20 22:20:45 +02:00
Bruno BELANYI
e7c7b7a6e1
nix: setup flake w/ pre-commit
2021-08-20 22:20:45 +02:00
Bruno BELANYI
5b57981af7
abacus: bootstrap build system
2021-08-20 22:20:45 +02:00