[SR-4634] Error in exact floating point initializers #47211
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: e3cafae41d33e915edd76d83f2a2b2b5
is 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.The text was updated successfully, but these errors were encountered: