MCPcopy Create free account
hub / github.com/chain/txvm / ModInt64

Function ModInt64

math/checked/checked.go:58–63  ·  view source on GitHub ↗

ModInt64 returns a % b with an integer overflow check.

(a, b int64)

Source from the content-addressed store, hash-verified

56// ModInt64 returns a % b
57// with an integer overflow check.
58func ModInt64(a, b int64) (remainder int64, ok bool) {
59 if b == 0 || (a == math.MinInt64 && b == -1) {
60 return 0, false
61 }
62 return a % b, true
63}
64
65// NegateInt64 returns -a
66// with an integer overflow check.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected