Commit graph

70 commits

Author SHA1 Message Date
Bruno BELANYI c9460c09d5 abacus: bignum: simplify is_canonicalized
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-17 10:13:29 +01:00
Bruno BELANYI a382b299b0 abacus: bignum: fix comparison of negative numbers 2022-02-17 10:03:21 +01:00
Bruno BELANYI 3e5133da1a ci: add package check phase
All checks were successful
continuous-integration/drone/push Build is passing
This takes care of launching the test suite.
2021-10-12 15:44:21 +02:00
Bruno BELANYI 8cb26ee316 abacus: bignum: use span
All checks were successful
continuous-integration/drone/push Build is passing
Once again, the code looks cleaner that way.
2021-10-12 15:05:43 +02:00
Bruno BELANYI 4ea7a38b61 abacus: use C++20 2021-10-12 15:05:43 +02:00
Bruno BELANYI da8b08e4e3 abacus: bignum: use IIFE
I think it looks cleaner to use Immediately Invoked Function Expressions
in such cases.
2021-10-12 15:02:37 +02:00
Bruno BELANYI 5c7c2af289 nix: use 'inputsFrom'
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-08 15:47:26 +02:00
Bruno BELANYI 171ef10a6d abacus: fix include directories
All checks were successful
continuous-integration/drone/push Build is passing
This cleans up one of my major pain points with the Meson way of doing
things.

The Meson solution to have nice includes would have been to create an
`include/<name>` directory per library I create...
2021-09-01 19:43:02 +02:00
Bruno BELANYI eb9295cfcd abacus: remove meson build system 2021-09-01 19:37:00 +02:00
Bruno BELANYI 6c0950dbe1 nix: use cmake instead of meson
All checks were successful
continuous-integration/drone/push Build is passing
2021-09-01 19:35:54 +02:00
Bruno BELANYI 09c628be60 nix: set 'doCheck'
It ensures that the `checkInputs` are being made part of
`nativeBuildInputs`.
2021-09-01 19:35:07 +02:00
Bruno BELANYI 331089d101 abacus: add cmake-based build system 2021-09-01 19:27:55 +02:00
Bruno BELANYI 549c1f0574 git: ignore 'result'
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-31 20:40:34 +02:00
Bruno BELANYI fa092f8876 ci: add Drone CI
Some checks failed
continuous-integration/drone/push Build is failing
2021-08-31 20:38:18 +02:00
Bruno BELANYI ac6b633c89 nix: remove 'meta.broken'
Now that we actually install the program...
2021-08-31 20:20:30 +02:00
Bruno BELANYI edd8d1f329 abacus: fix install 2021-08-31 20:20:22 +02:00
Bruno BELANYI be781b0d2f abacus: use static libraries
We do not want to install those libraries in any way.
2021-08-31 20:20:09 +02:00
Bruno BELANYI 9d8d3fa864 abacus: bignum: extract do_dump
Useful when debugging.
2021-08-23 19:24:53 +02:00
Bruno BELANYI c675b15248 abacus: bignum: optimize div_mod 2021-08-23 19:12:35 +02:00
Bruno BELANYI 1521d2b232 abacus: bignum: fix do_halve 2021-08-23 19:10:48 +02:00
Bruno BELANYI a99f60dcd4 abacus: bignum: move do_halve & is_odd up 2021-08-23 18:59:43 +02:00
Bruno BELANYI 31dcb91a26 abacus: bignum: add log10 2021-08-23 16:38:25 +02:00
Bruno BELANYI c730705a13 abacus: bignum: add log2 2021-08-23 16:33:05 +02:00
Bruno BELANYI 4b85d22923 abacus: bignum: add operator bool 2021-08-23 16:30:10 +02:00
Bruno BELANYI c9811fce44 abacus: bignum: rename do_trim_leading_zeros
It works in-place, unlike the rest of the `do_*` functions.
2021-08-23 16:14:22 +02:00
Bruno BELANYI 2046d1ec4b abacus: bignum: fix style of assignment
Using `auto <var> = <type>` is more consistent with the rest.
2021-08-23 16:12:53 +02:00
Bruno BELANYI f64c8775f3 nix: mark package as broken
For some reason I get an error when building under nix...
2021-08-23 01:04:17 +02:00
Bruno BELANYI 7f81f5fa7c nix: use checkInputs for GTest 2021-08-23 00:51:07 +02:00
Bruno BELANYI c06444f90c project: add LICENSE 2021-08-23 00:38:07 +02:00
Bruno BELANYI 1dbed201e6 abacus: parse: parser: store result of parse 2021-08-23 00:24:25 +02:00
Bruno BELANYI 46a0655e72 abacus: parse: scanner: define yyterminate 2021-08-23 00:24:05 +02:00
Bruno BELANYI 2d437a2583 abacus: parse: activate debug using ENV 2021-08-22 23:57:54 +02:00
Bruno BELANYI 6989d5209f utils: gdb: fix pretty-printing of BigNum
I was accumulating the digits in reverse...
2021-08-22 23:46:02 +02:00
Bruno BELANYI b50750009b abacus: parse standard output and output result 2021-08-22 14:37:49 +02:00
Bruno BELANYI 26055c5a3f abacus: parse: fix name of namespace 2021-08-22 14:37:32 +02:00
Bruno BELANYI e4aa81d1a4 fixup! abacus: parse: use BigNum instead of int 2021-08-22 14:37:09 +02:00
Bruno BELANYI d3c189bd1f abacus: parse: declare proper dependency
Due to creating a dependency, we should use `custom_target` rather a
`generator` expression.
2021-08-22 14:36:26 +02:00
Bruno BELANYI 60a0fbf5b0 abacus: parse: use BigNum instead of int 2021-08-22 14:14:27 +02:00
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