Skip to content

Decimal: Fix .doubleValue to use _length to only index valid mantissa elements. #1759

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 1 commit into from
Nov 12, 2018

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Nov 9, 2018

@spevans
Copy link
Contributor Author

spevans commented Nov 9, 2018

@swift-ci test linux

@spevans spevans requested a review from millenomi November 9, 2018 22:56
Copy link
Contributor

@millenomi millenomi left a comment

Choose a reason for hiding this comment

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

LGTM

@millenomi millenomi merged commit 17f150f into swiftlang:master Nov 12, 2018
xwu added a commit to swiftlang/swift that referenced this pull request Jun 25, 2019
* Update Decimal.swift

Fix `Decimal.magnitude` so that `Decimal.nan.magnitude` is no longer incorrectly `0`.
Port changes from swiftlang/swift-corelibs-foundation#1759, crucially correcting an error where `(0 as Decimal).doubleValue` returned `.nan`.

* [gardening] Zap indentation error

* Add test for `Decimal.nan.magnitude`

* Apply reviewer suggestion

Clean up `doubleValue`
millenomi pushed a commit that referenced this pull request Nov 11, 2020
* Update Decimal.swift

Fix `Decimal.magnitude` so that `Decimal.nan.magnitude` is no longer incorrectly `0`.
Port changes from #1759, crucially correcting an error where `(0 as Decimal).doubleValue` returned `.nan`.

* [gardening] Zap indentation error

* Add test for `Decimal.nan.magnitude`

* Apply reviewer suggestion

Clean up `doubleValue`
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.

2 participants