arith

package
v0.0.0-...-1b6ad0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add32WithOverflow

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

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

func Add32to64WithOverflow

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

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

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

func MulHalfPositiveWithOverflow

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

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

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

func Sub32to64WithOverflow

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

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

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL