Unexpected behavior when casting an NSNumber to Float
This is a consequence of SE-0170 NSNumber bridging and Numeric types, implemented in Swift 4: as? for NSNumber should mean “Can I safely express the value stored in this opaque box called a NSNumber as the value I want?”. 1.12 is a floating point literal, and inferred as a Double, so NSNumber(value: 1.12) is “boxing” … Read more