[swift-evolution] Implicit truncation
glessard at tffenterprises.com
Tue May 23 13:16:04 CDT 2017
I completely agree with Haravikk. This is not C, we have type inference, and this behaviour is different from other non-failable lossy conversions in Swift.
Regarding uses of ‘truncating’, Xiaodi is wrong. The documentation of BinaryInteger.init<T: FloatingPoint>(_ source: T) in the accepted proposal specifically uses the term in the way the original poster used it:
/// Creates an integer from the given floating-point value, truncating any
/// fractional part.
More information about the swift-evolution