cockroach: github.com/cockroachdb/cockroach/pkg/util/arith Index | Files

package arith

import "github.com/cockroachdb/cockroach/pkg/util/arith"

Index

Package Files

arith.go

func Add32WithOverflow Uses

func Add32WithOverflow(a, b int32) (r int32, ok bool)

Add32WithOverflow returns a+b. If ok is false, a+b overflowed.

func Add32to64WithOverflow Uses

func Add32to64WithOverflow(a int32, b int64) (r int32, ok bool)

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

func AddWithOverflow Uses

func AddWithOverflow(a, b int64) (r int64, ok bool)

AddWithOverflow returns a+b. If ok is false, a+b overflowed.

func MulHalfPositiveWithOverflow Uses

func MulHalfPositiveWithOverflow(a, b int64) (r int64, ok bool)

MulHalfPositiveWithOverflow returns a*b. b must be positive. If ok is false, a*b overflowed.

func Sub32WithOverflow Uses

func Sub32WithOverflow(a, b int32) (r int32, ok bool)

Sub32WithOverflow returns a-b. If ok is false, a-b overflowed.

func Sub32to64WithOverflow Uses

func Sub32to64WithOverflow(a int32, b int64) (r int32, ok bool)

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

func SubWithOverflow Uses

func SubWithOverflow(a, b int64) (r int64, ok bool)

SubWithOverflow returns a-b. If ok is false, a-b overflowed.

Package arith imports 1 packages (graph) and is imported by 7 packages. Updated 2019-07-27. Refresh now. Tools for package owners.