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-7761] Casting NSNumber to Float sometimes fails #3692

Open
swift-ci opened this issue May 24, 2018 · 2 comments
Open

[SR-7761] Casting NSNumber to Float sometimes fails #3692

swift-ci opened this issue May 24, 2018 · 2 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-7761
Radar None
Original Reporter stonehouse (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 6665dbaa4e4dc4c365a6afae0801a0f0

Issue Description:

This seems to be the same issue as described here, SR-5179. I also reported a different issue that has the same cause SR-7576

Casting an NSNumber to Float seems to use

@belkadan
Copy link

@phausler, I imagine you'll want to mark this as a dup? It's true that 0.2 as Double cannot be exactly represented as a Float.

@swift-ci
Copy link
Contributor Author

Comment by Alexander Stonehouse (JIRA)

Just to be clear the problem is that casting a NSNumber to Float fails if it can't be cleanly represented in Swift 4.1 but it did not fail in Swift 4.0.

This issue is a duplicate of SR-5179 except that my bug is 4.1 rather than Swift 3.2. It seems like this change was made in Swift 3.2 then reverted later, but this regression has been reintroduced in Swift 4.1

@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
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