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

Implement generic average #38

Merged
merged 4 commits into from
Sep 3, 2019
Merged

Implement generic average #38

merged 4 commits into from
Sep 3, 2019

Conversation

knothed
Copy link
Contributor

@knothed knothed commented Sep 1, 2019

Implements #36. Adds a simple protocol DivisibleArithmetic (matching the Swift-style of AdditiveArithmetic and Numeric). Double, Float and CGFloat conform to DivisibleArithmetic, allowing to take averages from Arrays of all three types.

Additionally, when calculating the average() of an Int Array, you can choose the return type to be anything complying with DivisibleArithmetic (not just Double as before).

Copy link
Member

@Jeehut Jeehut left a comment

Choose a reason for hiding this comment

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

Looking good. Could you please also add an entry to the changelog?

@knothed
Copy link
Contributor Author

knothed commented Sep 3, 2019

Yes, done!

@Jeehut Jeehut merged commit c9267a6 into FlineDev:stable Sep 3, 2019
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.

None yet

2 participants