[swift-users] Where to report this bug?

Alex Blewitt alblue at apple.com
Fri Sep 22 03:19:29 CDT 2017

Int.min is the smallest negative value, and Int.max is the largest positive value (that fits in an Int). However, the absolute value of Int.min is larger than the absolute value of Int.max. So you can't convert Int.min into -Int.min because it's larger than Int.max.

In other words, this is expected behaviour :)

For example:

Int.min + Int.max = 1

If they were the same value, it would be zero.


> On 22 Sep 2017, at 02:42, Peter W A Wood via swift-users <swift-users at swift.org> wrote:
> Entering the following statement in a playground gives an overflow error. Where should I report this?
> Statement:
> Int.min.dividedReportingOverflow(by:-1)
> Playground log:
> Playground execution failed:
> error: MyPlayground.playground:3:9: error: division '-9223372036854775808 / -1' results in an overflow
> Int.min.dividedReportingOverflow(by:-1)
> Peter
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170922/009b4e18/attachment.html>

More information about the swift-users mailing list