dsmath

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WAD *big.Int = integer.TenPow(18)
)

Functions

func FromWAD added in v0.2.2

func FromWAD(x *big.Int, d uint8) *big.Int

FromWAD Convert x from WAD (18 decimals) to d decimals.

func ToWAD added in v0.2.2

func ToWAD(x *big.Int, d uint8) *big.Int

ToWad Convert x to WAD (18 decimals) from d decimals.

func WDiv

func WDiv(x *big.Int, y *big.Int) *big.Int

WDiv ((x * WAD) + (y / 2)) / y

func WMul

func WMul(x *big.Int, y *big.Int) *big.Int

WMul ((x * y) + (WAD / 2)) / WAD;

Types

This section is empty.

Jump to

Keyboard shortcuts

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