Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Int - cross compatibility with Uint #699

Draft
wants to merge 81 commits into
base: signed-int
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4bc098c
Create `Int` core struct
erik-3milabs Sep 23, 2024
31e3577
Introduce `Int::add`
erik-3milabs Oct 15, 2024
cfb1ec4
Introduce `Int::mul`
erik-3milabs Oct 15, 2024
01a07f7
Introduce `Int::div`
erik-3milabs Oct 15, 2024
000c007
Implement `Div` for `Int`
erik-3milabs Oct 16, 2024
39b08bb
Clean up
erik-3milabs Oct 16, 2024
7b0fbab
Implement `Sub` for `Int`
erik-3milabs Oct 16, 2024
66b4639
Fix typo in `Uint::sub`
erik-3milabs Oct 16, 2024
02d9d5c
Implement `WrappingSub` for `Int`
erik-3milabs Oct 16, 2024
e614cd5
Implement `cmp` for `Int`
erik-3milabs Oct 16, 2024
da13a4f
Implement `rand` for `Int`
erik-3milabs Oct 16, 2024
69b7236
Implement `expand` for `Int`
erik-3milabs Oct 16, 2024
20cdb5f
Update `Int::encoding`
erik-3milabs Oct 16, 2024
4ab45f5
Add `Int` aliases
erik-3milabs Oct 16, 2024
57000c5
Impl some more `Int` traits
erik-3milabs Oct 16, 2024
e29e425
Add `Int` benchmarks
erik-3milabs Oct 16, 2024
869a8e7
Remove superfluous tests
erik-3milabs Oct 16, 2024
f6ef7ed
Fix fmt
erik-3milabs Oct 16, 2024
c610b08
Introduce `Int::new_from_uint`
erik-3milabs Oct 16, 2024
0669c1b
Feature lock `Int::rand`
erik-3milabs Oct 16, 2024
d7029e2
Add `Int::cmp` tests
erik-3milabs Oct 16, 2024
a653375
Fix `Int::expand` bug
erik-3milabs Oct 16, 2024
57f65f8
Attach `Int` benchmark
erik-3milabs Oct 16, 2024
b23483d
Improve `Int` benchmarks
erik-3milabs Oct 16, 2024
30b4676
Speed up `Int::negate_unsafe`
erik-3milabs Oct 16, 2024
580e0a5
Improve `Int::sign_bit`
erik-3milabs Oct 16, 2024
220d329
Remove useless conversion
erik-3milabs Oct 16, 2024
c762307
Fix `Int::as_uint` return type
erik-3milabs Oct 17, 2024
98075bb
Rename `Uint::wrapping_negc` to `wrapping_neg_with_carry`
erik-3milabs Oct 17, 2024
a064fea
Make `Int::sign_bit` `const`
erik-3milabs Oct 17, 2024
8bcf5ef
Rename `Int::sign_bit` to `Int::is_negative`
erik-3milabs Oct 17, 2024
8e598b6
Move `Int`'s negation operations to `int::neg`
erik-3milabs Oct 17, 2024
22582a2
Expand `int::neg` tests
erik-3milabs Oct 17, 2024
74b377b
Some cleaning up
erik-3milabs Oct 17, 2024
8fad5d4
Introduce `ConstChoice::as_word_mask`
erik-3milabs Oct 17, 2024
d8a6a91
Introduce `Uint::wrapping_neg_if`
erik-3milabs Oct 17, 2024
2033850
Refactor `Int::negate_if_unsafe`, make `split_mul` `const` in the pro…
erik-3milabs Oct 17, 2024
cff448c
Make `Int::new_from_sign_and_magnitude` `const`
erik-3milabs Oct 17, 2024
d326432
Make `Int::checked_add_internal` `const`
erik-3milabs Oct 17, 2024
cb9967f
Rename `Int::checked_add_internal` to `Int::checked_add`
erik-3milabs Oct 17, 2024
0a7155b
Refactor `Int::expand` to `Int::resize`
erik-3milabs Oct 17, 2024
9d7b1d9
Rename `Uint::wrapping_neg_with_carry` to `Uint::negc`
erik-3milabs Oct 17, 2024
93f9a45
Rename `Int`'s negation functions.
erik-3milabs Oct 17, 2024
0f2009f
Rename `Int::is_minimal` to `Int::is_min`
erik-3milabs Oct 17, 2024
e182faf
Rename `Int::is_maximal` to `Int::is_max`
erik-3milabs Oct 17, 2024
2fa8bc1
Rename `Int::SIGN_BIT_MASK` to `Int::SIGN_MASK`
erik-3milabs Oct 17, 2024
6050c7e
Satisfy clippy
erik-3milabs Oct 17, 2024
e9ad737
Fix carry on `Uint::negc`
erik-3milabs Oct 17, 2024
6bffaed
Impl serde for `Int`
erik-3milabs Oct 17, 2024
33b94cf
Fix serde for `Int`
erik-3milabs Oct 17, 2024
7c70799
Fix serde for `Int` attempt 2
erik-3milabs Oct 17, 2024
c7642e5
Implement `Int::from`
erik-3milabs Oct 18, 2024
080c6c8
Fix `Int::resize` bug
erik-3milabs Oct 18, 2024
d53a0ef
Fix `Int::from`
erik-3milabs Oct 18, 2024
8947396
Impl `Int::div_floor` and `Int::div_mod_floor`
erik-3milabs Oct 18, 2024
35fe35d
Fix problems
erik-3milabs Oct 18, 2024
8ec01c3
Attempt to fix from_i64 for x86 platform
erik-3milabs Oct 18, 2024
3378cbb
Attempt #2
erik-3milabs Oct 18, 2024
d2e5692
Introduce `lte` and `gte` for `Uint`
erik-3milabs Oct 21, 2024
6e04109
Introduce `lte` and `gte` for `Int`
erik-3milabs Oct 21, 2024
34290de
Update `Int::div_rem`
erik-3milabs Oct 21, 2024
cb67265
Add widening_mul, group absolute value operations, reformat.
lleoha Oct 17, 2024
3773bb7
bench
lleoha Oct 18, 2024
e218afa
Address review remarks, add benchmarks.
lleoha Oct 18, 2024
e61537f
Update src/int/sign.rs
erik-3milabs Oct 21, 2024
2624a8a
Refine.
lleoha Oct 21, 2024
23f1f4a
reformat
lleoha Oct 21, 2024
c8edd3d
Merge pull request #1 from lleoha/widening-mul
erik-3milabs Oct 22, 2024
6543016
Deprecate `Uint::gte`
erik-3milabs Oct 22, 2024
51f269a
Clean `Int::div`
erik-3milabs Oct 22, 2024
4cfff41
Create `Int::bit_and`
erik-3milabs Oct 22, 2024
3f427e3
Create `Int::bit_or`
erik-3milabs Oct 22, 2024
03ef0b8
Create `Int::bit_xor`
erik-3milabs Oct 22, 2024
e2e5334
Create `Int::bit_not`
erik-3milabs Oct 22, 2024
83937b0
Implement `Int::shl`
erik-3milabs Oct 22, 2024
4246f34
Implement `Int::shr`
erik-3milabs Oct 22, 2024
e83d77c
Remove superfluous `.into`
erik-3milabs Oct 22, 2024
8af2deb
Implement `Int::gcd`
erik-3milabs Oct 22, 2024
c36de5b
Implement `int::mul_uint`
erik-3milabs Oct 24, 2024
c5142ac
Implement `int::div_uint`
erik-3milabs Oct 24, 2024
94b0b19
Fix clippy
erik-3milabs Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target
proptest-regressions

.idea/
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ harness = false
[[bench]]
name = "uint"
harness = false

[[bench]]
name = "int"
harness = false
Loading