Rust icon indicating copy to clipboard operation
Rust copied to clipboard

Fast Inverse Square Root and Amicable Numbers

Open Riceman2000 opened this issue 3 years ago • 0 comments

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.rs which 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 warning just 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 fmt just before my last commit.
  • [x] I ran cargo test just before my last commit and all tests passed.
  • [x] I checked COUNTRIBUTING.md and my code follows its guidelines.

If you need any changes made let me know, thanks!

Riceman2000 avatar Sep 11 '22 17:09 Riceman2000