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

Added geometric mean to averages.rs #846

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Marmaa0
Copy link

@Marmaa0 Marmaa0 commented Dec 8, 2024

Description

Added a geometric mean to the averages.rs file, whilst mean, median and mode are certainly more standard than the geometric mean, it is often used within finance, and a valuable average when confronted with sequences which have a multiplicative nature. I've tried to follow the same style as the previous averages, I'm very new to rust and programming in general so I apologise in advance if I have made some obvious or glaring errors.

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I ran bellow commands using the latest version of rust nightly.
  • I ran cargo clippy --all -- -D warnings just before my last commit and fixed any issue that was found.
  • I ran cargo fmt just before my last commit.
  • I ran cargo test just before my last commit and all tests passed.
  • I added my algorithm to the corresponding mod.rs file within its own folder, and in any parent folder(s).
  • I added my algorithm to DIRECTORY.md with the correct link.
  • I checked COUNTRIBUTING.md and my code follows its guidelines.

…s the previous averages. This is a core average function used in finance amongst other areas. I've added some tests to go with it.
@Marmaa0 Marmaa0 requested review from imp2002 and vil02 as code owners December 8, 2024 15:52
@Marmaa0 Marmaa0 changed the title Added geometric mean to av erages.rs Added geometric mean to averages.rs Dec 8, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.45%. Comparing base (f66f836) to head (28b198d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #846      +/-   ##
==========================================
+ Coverage   95.44%   95.45%   +0.01%     
==========================================
  Files         316      316              
  Lines       22750    22806      +56     
==========================================
+ Hits        21713    21769      +56     
  Misses       1037     1037              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants