-
Notifications
You must be signed in to change notification settings - Fork 171
Gmean, Hmean expanded for other datatypes #956
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
Conversation
Co-authored-by: Smit Lunagariya <smitlunagariya.mat18@itbhu.ac.in>
Co-authored-by: Smit Lunagariya <smitlunagariya.mat18@itbhu.ac.in>
src/runtime/statistics.py
Outdated
@@ -115,11 +115,51 @@ def geometric_mean(x: list[i32]) -> f64: | |||
i: i32 | |||
|
|||
for i in range(k): | |||
if(x[i]<=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<=0): | |
if x[i] <= 0: |
src/runtime/statistics.py
Outdated
i: i32 | ||
|
||
for i in range(k): | ||
if(x[i]<=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<=0): | |
if x[i] <= 0: |
src/runtime/statistics.py
Outdated
i: i32 | ||
|
||
for i in range(k): | ||
if(x[i]<=0.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<=0.0): | |
if x[i] <= 0.0: |
src/runtime/statistics.py
Outdated
@@ -134,6 +174,49 @@ def harmonic_mean(x: list[i32]) -> f64: | |||
for i in range(k): | |||
if x[i] == 0: | |||
return 0.0 | |||
if(x[i]<0.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<0.0): | |
if x[i] < 0.0: |
src/runtime/statistics.py
Outdated
for i in range(k): | ||
if x[i] == 0: | ||
return 0.0 | ||
if(x[i]<0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<0): | |
if x[i] < 0: |
src/runtime/statistics.py
Outdated
for i in range(k): | ||
if x[i] == 0.0: | ||
return 0.0 | ||
if(x[i]<0.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(x[i]<0.0): | |
if x[i] < 0.0: |
@Madhav2310 -- please read PEP 8. |
I removed |
No description provided.