-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
Can one of the admins verify this patch? |
5 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
cc @Lukasa |
@swift-server-bot add to allowlist |
There was a problem hiding this 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.
Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
Outdated
Show resolved
Hide resolved
Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
Outdated
Show resolved
Hide resolved
Co-authored-by: Cory Benfield <lukasa@apple.com>
Thanks for catching that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice fix!
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 toDecimal.init(sign:exponent:significand:)
.Works around SR-15132.