Skip to content

Commit

Permalink
add example of bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jcp19 committed Nov 15, 2024
1 parent e70a229 commit fe1daa8
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

package main

// ##(--overflow)

const MinInt64 = -9223372036854775808 // = -1 << 63
// @ requires x > MinInt64
// @ ensures res >= 0
func abs(x int64) (res int64) {
if x < 0 {
return -x
} else {
return x
}
}

0 comments on commit fe1daa8

Please sign in to comment.