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-71] NSNumber returns incorrect values for doubleValue #4476

Closed
swift-ci opened this issue Dec 5, 2015 · 2 comments
Closed

[SR-71] NSNumber returns incorrect values for doubleValue #4476

swift-ci opened this issue Dec 5, 2015 · 2 comments

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Dec 5, 2015

Previous ID SR-71
Radar None
Original Reporter owensd (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug
Assignee argon (JIRA)
Priority Medium

md5: 8b89e8bd40a4b3ea233124ebc089cf9a

Issue Description:

NSNumber is pretty broken for floating point values.

let d1 = Double(42)
let d2 = NSNumber(double: Double(42)).doubleValue

Debugger values:

d1 Double 42 42
d2 Double 4.6311077918204232E+18 4.6311077918204232E+18

@swift-ci
Copy link
Contributor Author

swift-ci commented Dec 6, 2015

Comment by Andrew Naylor (JIRA)

This should be fixed here: #52

@parkera
Copy link
Member

parkera commented Dec 6, 2015

Merged PR #52.

@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