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

SE-0113 + residual SE-0067 work #3443

Merged
merged 3 commits into from Jul 11, 2016
Merged

SE-0113 + residual SE-0067 work #3443

merged 3 commits into from Jul 11, 2016

Conversation

stephentyrone
Copy link
Member

@stephentyrone stephentyrone commented Jul 11, 2016

What's in this pull request?

This pull request adds the following to FloatingPoint:

func rounded(_ rule: FloatingPointRoundingRule) -> Self
mutating func round(_ rule: FloatingPointRoundingRule)
func remainder(dividingBy other: Self) -> Self
mutating func formRemainder(dividingBy other: Self)
func squareRoot() -> Self
mutating func formSquareRoot()
func addingProduct(_ lhs: Self, _ rhs: Self) -> Self
mutating func addProduct(_ lhs: Self, _ rhs: Self)

The first two are SE-0113. The others are residual work for SE-0067.

Resolved bug number: (SR-2010)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

@stephentyrone
Copy link
Member Author

@swift-ci Please test.


@_transparent
public var nextDown: Self {
return -(-self).nextUp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a stopgap or really the way nextDown is intended to be implemented?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a default provided to simplify the implementation burden on types that want to conform. (FWIW however, I don't expect most types will override this, as it's fairly efficient for any reasonable conforming type, and these operations tend not to be used in performance-sensitive contexts).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense. I only asked because, above, you seem to have removed CGFloat.nextDown in favor of this default implementation.

@stephentyrone
Copy link
Member Author

@swift-ci please test.

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

3 participants