Friday, 6 January 2017

Swift divideWithOverflow Update

In a previous post, Swift int32divideWithOverflow doesn't, I mentioned that I found an unusual circumstance when int32divideWithOverflow crashes with an overflow error. When I asked on the Swift mailing list, somebody responded that this was the correct behaviour.

This didn't sit comfortably with me. I just didn't seem correct. So I posted an issue on the Swift bug tracker suggesting that this behaviour be documented so that anybody else coming across it would be forewarned.

I am pleased to report that the Swift team feel that this is a bug so it could well get fixed in a future release. You can take a look at the bug report to see the details.

No comments: