Rust
Rust copied to clipboard
Fast Inverse Square Root and Amicable Numbers
Description
- Added the Fast Inverse Square Root Algorithm and tests for it. This is the well known 'Quake' implementation: https://en.wikipedia.org/wiki/Fast_inverse_square_root
- Added a file
./src/math/amicable_numbers.rswhich included a function to find amicable pairs below N and that function's tests. This solution leverages a novel approach using array indexing.
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
- [x] I ran bellow commands using the latest version of rust nightly.
- [x] I ran
cargo clippy --all -- -D warningjust before my last commit and fixed any issue that was found.- Note: There are other files that generate warnings with the latest rust nightly build but those fixes should be a separate PR
- [x] I ran
cargo fmtjust before my last commit. - [x] I ran
cargo testjust before my last commit and all tests passed. - [x] I checked
COUNTRIBUTING.mdand my code follows its guidelines.
If you need any changes made let me know, thanks!