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

[SR-13471] Mismatch between behavior of quotientAndRemainder and docs #55913

Closed
typesanitizer opened this issue Aug 28, 2020 · 3 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@typesanitizer
Copy link

Previous ID SR-13471
Radar rdar://problem/67957914
Original Reporter @typesanitizer
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 2a0e1889343aa507c042bce8bf12577a

Issue Description:

According to https://developer.apple.com/documentation/swift/binaryinteger/3017639-quotientandremainder,

> A tuple containing the quotient and remainder of this value divided by rhs. The remainder has the same sign as rhs.

However, running it shows that's not the case:

$ echo 'print((10 as Int).quotientAndRemainder(rhs: -3))' | xcrun swift
(quotient: -3, remainder: 1)

Is there an implementation bug here or a documentation bug?

@typesanitizer
Copy link
Author

@swift-ci create

@stephentyrone
Copy link
Member

Documentation bug.

@stephentyrone
Copy link
Member

#33711

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants