Files
swift-mirror/stdlib/public/SwiftShims/RuntimeShims.h
tbkka 5d30503894 When parsing floating-point from String, underflow to 0, overflow to infinity (#34339)
Previously, overflow and underflow both caused this to return `nil`, which causes several problems:
* It does not distinguish between a large but valid input and a malformed input.  `Float("3.402824e+38")` is perfectly well-formed but returns nil
* It differs from how the compiler handles literals.  As a result, `Float(3.402824e+38)` is very different from `Float("3.402824e+38")`
* It's inconsistent with Foundation Scanner()
* It's inconsistent with other programming languages

This is exactly the same as #25313

Fixes rdar://problem/36990878
2020-10-19 09:44:57 -04:00

3.4 KiB