checked

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package checked implements basic checked arithmetic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(x, y uint64) (sum uint64, ok bool)

Add returns x + y and a bool indicating whether the addition was successful.

func Mul

func Mul(x, y uint64) (prod uint64, ok bool)

func MulBigPow10

func MulBigPow10(z, x *big.Int, n uint64) *big.Int

MulBigPow10 sets z to x * 10**n and returns z.

func MulPow10

func MulPow10(x uint64, n uint64) (uint64, bool)

MulPow10 computes x * 10**n and a bool indicating whether the multiplcation was successful.

func Sub

func Sub(x, y uint64) (diff uint64, ok bool)

Sub returns x - y and a bool indicating whether the subtraction was successful.

Types

This section is empty.

Jump to

Keyboard shortcuts

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