Skip to content

Update for open-source Decimal fixes #16

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 4 commits into from
Jan 4, 2022
Merged

Conversation

xwu
Copy link
Contributor

@xwu xwu commented Dec 28, 2021

These are minimal changes to ensure cross-platform and future-proof usage of Foundation.Decimal APIs that have incorporated various fixes on Linux that may or may not be incorporated in future Apple releases also.

In brief, we'll always take the magnitude (absolute value) of the value that's returned from Decimal.significand and always in turn provide a positive significand to Decimal.init(sign:exponent:significand:).

Works around SR-15132.

@swift-server-bot
Copy link

Can one of the admins verify this patch?

5 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@xwu
Copy link
Contributor Author

xwu commented Dec 28, 2021

cc @Lukasa

@Lukasa
Copy link
Contributor

Lukasa commented Jan 4, 2022

@swift-server-bot add to allowlist

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

This generally looks good! A few minor nits here.

Co-authored-by: Cory Benfield <lukasa@apple.com>
@xwu
Copy link
Contributor Author

xwu commented Jan 4, 2022

Thanks for catching that!

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

LGTM, nice fix!

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jan 4, 2022
@Lukasa Lukasa merged commit 8c5c9aa into apple:main Jan 4, 2022
@xwu xwu deleted the decimal-significand branch January 5, 2022 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants