-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.good first issueGood for newcomersGood for newcomersstandard libraryArea: Standard library umbrellaArea: Standard library umbrella
Description
| Previous ID | SR-2626 |
| Radar | rdar://problem/26720376 |
| Original Reporter | @gribozavr |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Standard Library |
| Labels | Bug, StarterBug |
| Assignee | @hartbit |
| Priority | Medium |
md5: ba2c6f38b18ec9c711fa49aecc0453e6
Issue Description:
The string -> floating-point intializer doesn’t allow you to create signaling NaN values. In the following code, y == nil, but should have the same value as x:
let x = Double(nan: 0, signaling: true) // OK
let y = Double("snan") // nilThis relates to section 5.12.1 of IEEE 754:
Conversion of an external character sequence “snan” (regardless of case) with an optional preceding sign, to a supported format should either produce a signaling NaN or else produce a quiet NaN and signal the invalid operation exception.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.good first issueGood for newcomersGood for newcomersstandard libraryArea: Standard library umbrellaArea: Standard library umbrella