[SR-13997] Parsing out of range Floats returns different results on macOS v Linux #56392
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
macOS 11.1 Xcode 12.3
Linux Ubuntu18.04
swift-DEVELOPMENT-SNAPSHOT-2020-12-23-a-ubuntu18.04
Additional Detail from JIRA
md5: 739f49d3d89dfd42734adfb82130b36d
Issue Description:
When parsing a number too big to fit in a floating point type, macOS returns
nil
and Linux returns-inf/inf
. Unfortunately the documentation is a little sparse on the expected result.macOS
Linux
Note however that
strtod
et al return the same results on macOS and LinuxmacOS
Linux
I couldn't find anywhere in the stdlib where the errno 34 (ERANGE) was being handled to convert the result to
nil
on macOS.The text was updated successfully, but these errors were encountered: