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

Function LshiftUint64

math/checked/checked.go:213–221  ·  view source on GitHub ↗

LshiftUint64 returns a << b with an integer overflow check.

(a, b uint64)

Source from the content-addressed store, hash-verified

211// LshiftUint64 returns a << b
212// with an integer overflow check.
213func LshiftUint64(a, b uint64) (result uint64, ok bool) {
214 if b >= 64 {
215 return 0, false
216 }
217 if a > math.MaxUint64>>uint(b) {
218 return 0, false
219 }
220 return a << uint(b), true
221}
222
223// AddUint32 returns a + b
224// with an integer overflow check.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected