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-4800] Float.init?(exactly: UInt32) does not return nil for UInt32.max or other un-representable values #47377

Closed
phausler opened this issue May 4, 2017 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@phausler
Copy link
Member

phausler commented May 4, 2017

Previous ID SR-4800
Radar None
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee None
Priority Medium

md5: 474eb7c2645dc27de8d19a97365fd3c7

duplicates:

  • SR-4634 Error in exact floating point initializers

Issue Description:

        let u1 = UInt32.max
        let u2 = UInt32.max - 1
        
        let f1 = Float(u1)
        let f2 = Float(u2)
        
        let f3 = Float(exactly: u1) // should be nil but isn't
        let f4 = Float(exactly: u2) // should be nil but isn't
@phausler
Copy link
Member Author

phausler commented May 4, 2017

likely a duplicate of SR-4634

@belkadan
Copy link
Contributor

belkadan commented May 5, 2017

cc @moiseev

@xwu
Copy link
Collaborator

xwu commented Feb 14, 2018

Looks like this was resolved by Nate in #12739.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants