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

Function ModInt32

math/checked/checked.go:138–143  ·  view source on GitHub ↗

ModInt32 returns a % b with an integer overflow check.

(a, b int32)

Source from the content-addressed store, hash-verified

136// ModInt32 returns a % b
137// with an integer overflow check.
138func ModInt32(a, b int32) (remainder int32, ok bool) {
139 if b == 0 || (a == math.MinInt32 && b == -1) {
140 return 0, false
141 }
142 return a % b, true
143}
144
145// NegateInt32 returns -a
146// with an integer overflow check.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected