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

Use QDigit in square algorithm if it is available #5

Merged
merged 1 commit into from
Dec 1, 2024
Merged

Conversation

OTheDev
Copy link
Owner

@OTheDev OTheDev commented Dec 1, 2024

Currently, the multiple-precision squaring algorithm used needs space for 3 times the width of a Digit and this is achieved by using two double digits DDigit to act as one QDigit.

When Digit::BITS is 32 bits or less, an unsigned integer type with width equal to 4 times the width of a Digit exists: QDigit.

This PR updates the algorithm to use QDigit explicitly if it is available, rather than implement QDigit on the fly using two DDigits.

This improves maintainability and potentially, efficiency.

@OTheDev OTheDev merged commit d659f11 into main Dec 1, 2024
4 checks passed
@OTheDev OTheDev deleted the use_qdigit branch December 1, 2024 16:57
OTheDev added a commit that referenced this pull request Dec 2, 2024
* Use 'latest' docs.rs documentation links in README (#3)
* Add license and contributing sections to README (#4)
* Use QDigit in square algorithm if it is available (#5)
* Remove unreachable branch in mul_standard() (#6)
* Forbid unsafe code (#7)
* Add module with impl. of builtin int methods (#8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant