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-14974] Decimal.ulp produces inaccurate results #3365

Closed
xwu opened this issue Jul 25, 2021 · 2 comments
Closed

[SR-14974] Decimal.ulp produces inaccurate results #3365

xwu opened this issue Jul 25, 2021 · 2 comments
Assignees

Comments

@xwu
Copy link
Collaborator

xwu commented Jul 25, 2021

Previous ID SR-14974
Radar rdar://problem/81168000
Original Reporter @xwu
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @xwu
Priority Medium

md5: fbaeda0ee5863a50d2ef42e50dc397c0

relates to:

  • SR-6671 Decimal.leastNonzeroMagnitude, leastNormalMagnitude should have -128 exponent
  • SR-14384 Decimal nextUp/nextDown don't match docs

Issue Description:

This issue is related to SR-14384 (and somewhat to SR-6671).

The result of .ulp should reflect the spacing between two consecutive representable numbers, but currently the result reflects the idiosyncratic internal representation of Decimal values such that the unit in the last place of, say, 0.1 is allegedly 0.1.

Changes to the behavior of this property should be made in sync with that of .nextUp and .nextDown as reported in SR-14384, and ideally we should correct the implementation of .leastNonzeroMagnitude and .leastNormalMagnitude while we're at it.

@typesanitizer
Copy link

@swift-ci create

@xwu
Copy link
Collaborator Author

xwu commented Sep 9, 2021

#3068

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants