MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Sub32to64WithOverflow

Function Sub32to64WithOverflow

postgres/parser/utils/arith.go:73–78  ·  view source on GitHub ↗

Sub32to64WithOverflow returns a-b. If ok is false, b was outside the int32 range or a-b overflowed.

(a int32, b int64)

Source from the content-addressed store, hash-verified

71// Sub32to64WithOverflow returns a-b. If ok is false, b was outside the
72// int32 range or a-b overflowed.
73func Sub32to64WithOverflow(a int32, b int64) (r int32, ok bool) {
74 if b > math.MaxInt32 || b < math.MinInt32 {
75 return 0, false
76 }
77 return Sub32WithOverflow(a, int32(b))
78}
79
80// Sub32WithOverflow returns a-b. If ok is false, a-b overflowed.
81func Sub32WithOverflow(a, b int32) (r int32, ok bool) {

Callers 1

SubDaysMethod · 0.92

Calls 1

Sub32WithOverflowFunction · 0.85

Tested by

no test coverage detected