Skip to content

Add Division#6

Open
Totto16 wants to merge 115 commits into
mainfrom
division
Open

Add Division#6
Totto16 wants to merge 115 commits into
mainfrom
division

Conversation

@Totto16
Copy link
Copy Markdown
Owner

@Totto16 Totto16 commented Oct 26, 2025

No description provided.

- test for NULL or invalid bigints in * inputs , and as gcovr can't detect thrown assertions, disable the coverage there
use it in all cases we did it manually before
- only implement left shift atm
- add variants, that accept uint64_t,. as most of the time a shift larger than that is not really needed
- implement the c++ operators for newly added functions
- these are just signatures, they are not really implemented yet
- only left shift is currently implemented
- these are just at the beginning and not even nearly finished, but at least some skeleton is here
- it could overflow, if the dividend + divisor was too big resulting in an incorrect result
- also added a template to profit from divmod assembly instructions in the future
- the reasons for that are:
- the numbers get that huge, that tha numbers_count would overflow
- you never have enough memory to store it anyways, as even 32432542364367347ULL would require 4 TB of memory, and isn't even close to 18446744073709551615
- fix shifts of 1 instead of U64(1), that triggered overflow and also change wrong datatypes to bet the correct with
- fix loop not correctly offsetting the number limbs iif amount >= 64
- rename one that only removes leading zeroes, and doesn't normalize
- add another function that also normalizes, that is e.g. needed in the shift right implementation as before and after removing leadings zeroes, we need to check for -0
- make a +0  rather than using the previous sign, so it may become a -0
- as that requires both arrays to be different, we need to catch the case, where they are the same, which is always a good idea, as this is really simple in terms of what the result is, xor => all 0s, or and and, just a memcpy
-  previously it wasn't checked in hardware accelerated functions
- the release function didn't do the correct thing, now using a unique_ptr, so that it works correctly
-  one test implementation is now removed, in favor of the builtin mod
- detect number_count == 0 error, and report it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant