Skip to content

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

Merged
merged 10 commits into from
Aug 14, 2022
Merged

Conversation

Madhav2310
Copy link
Contributor

No description provided.

Madhav2310 and others added 2 commits August 12, 2022 14:18
Co-authored-by: Smit Lunagariya <smitlunagariya.mat18@itbhu.ac.in>
Co-authored-by: Smit Lunagariya <smitlunagariya.mat18@itbhu.ac.in>
@@ -115,11 +115,51 @@ def geometric_mean(x: list[i32]) -> f64:
i: i32

for i in range(k):
if(x[i]<=0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<=0):
if x[i] <= 0:

i: i32

for i in range(k):
if(x[i]<=0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<=0):
if x[i] <= 0:

i: i32

for i in range(k):
if(x[i]<=0.0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<=0.0):
if x[i] <= 0.0:

@@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<0.0):
if x[i] < 0.0:

for i in range(k):
if x[i] == 0:
return 0.0
if(x[i]<0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<0):
if x[i] < 0:

for i in range(k):
if x[i] == 0.0:
return 0.0
if(x[i]<0.0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(x[i]<0.0):
if x[i] < 0.0:

@namannimmo10
Copy link
Collaborator

@Madhav2310 -- please read PEP 8.

@Madhav2310 Madhav2310 requested a review from czgdp1807 August 13, 2022 04:56
@czgdp1807 czgdp1807 enabled auto-merge (squash) August 13, 2022 15:02
@czgdp1807 czgdp1807 merged commit a4443dc into lcompilers:main Aug 14, 2022
@czgdp1807
Copy link
Collaborator

I removed coviariance and correlation for now from this PR. You can add it in a new PR. Thanks for contributing.

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.

4 participants