Closed martinr448 closed 6 years ago
@swift-ci create
Comment by Ian Partridge (JIRA)
https://github.com/apple/swift/pull/11311 is open to fix this.
Looking forward to getting this fixed as it blocks improving the test coverage for NSNumber bridging in swift-corelibs-foundation.
Looks like this was resolved in #12739 (by Nate).
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 1 | |Component/s | Standard Library | |Labels | Bug | |Assignee | @natecook1000 | |Priority | Medium | md5: e3cafae41d33e915edd76d83f2a2b2b5is duplicated by:
Issue Description:
The exact conversion from integers to floating point types succeeds even if precision is lost. Example:
The reason is a wrong preprocessor condition at FloatingPointTypes.swift.gyb:L840:
which means that the test it not performed if the integer has more bits than the mantissa of the floating point type.
It should be
if srcBits >= SignificandBitCount:
orif srcBits > SignificandBitCount:
instead.