Tangential, but isn't this already a problem in C? My copy of limits.h
contains definitions such as
#define INT_MIN (-2147483647 - 1)
I still think it would be an unfortunate behavior to have in Swift.
Even if it only affected Double
, it could still be source-breaking in some edge cases:
var x: Double = 0
var y: Double = -0
let identical = (memcmp(&x, &y, MemoryLayout<Double>.size) == 0)
// true before, false if we change integer literal behavior