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

Add Augmented.sum(_:_:) aka "twoSum" #208

Merged
merged 6 commits into from
Oct 27, 2021
Merged

Conversation

markuswntr
Copy link
Contributor

@markuswntr markuswntr commented Oct 21, 2021

With augmented arithmetic in place, I was wondering if we might as well add "twoSum" alongside the existing "fast2sum".
https://en.wikipedia.org/wiki/2Sum

As with "fast2sum", which is currently used for the elementary function of complex numbers, "twoSum" would be useful for the elementary function of quaternions where, due the additional pair of imaginary numbers, the magnitudes of the summands can not be guaranteed to be in any order.

@markuswntr markuswntr changed the title Add Augmented.sum(_:_:) aka twoSum Add Augmented.sum(_:_:) aka "twoSum" Oct 21, 2021
@stephentyrone
Copy link
Member

Mind adding a couple test cases?

@stephentyrone
Copy link
Member

@swift-ci test

markuswntr and others added 2 commits October 27, 2021 08:28
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
@stephentyrone
Copy link
Member

@swift-ci test

@stephentyrone
Copy link
Member

I'll probably write some additional documentation for this down the road, but LGTM as is for now.

@stephentyrone stephentyrone merged commit c74d817 into apple:main Oct 27, 2021
@markuswntr markuswntr deleted the two-sum branch October 27, 2021 19:37
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.

3 participants