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

Function LshiftUint32

math/checked/checked.go:270–278  ·  view source on GitHub ↗

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

(a, b uint32)

Source from the content-addressed store, hash-verified

268// LshiftUint32 returns a << b
269// with an integer overflow check.
270func LshiftUint32(a, b uint32) (result uint32, ok bool) {
271 if b >= 32 {
272 return 0, false
273 }
274 if a > math.MaxUint32>>uint(b) {
275 return 0, false
276 }
277 return a << uint(b), true
278}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected