number

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxValue = Number(math.MaxInt64)

MaxValue is the largest possible value

View Source
const MinValue = Number(math.MinInt64)

MinValue is the smallest possible value

View Source
const MinusOne = Number(-1000)

MinusOne as constant

View Source
const One = Number(1000)

One as constant

View Source
const Zero = Number(0)

Zero as constant

Variables

This section is empty.

Functions

This section is empty.

Types

type Number

type Number int64

Number is a fixed-point 3-digit number type

func FromFloat32 added in v0.0.34

func FromFloat32(in float32) Number

FromFloat32 creates a Number from the given float

func FromFloat64

func FromFloat64(in float64) Number

FromFloat64 creates a Number from the given float

func FromInt

func FromInt(in int) Number

FromInt creates a Number from the given int

func FromString

func FromString(str string) (Number, error)

FromString parses a string into a Number

func MustFromString

func MustFromString(str string) Number

MustFromString parses a string into a Number. Panics on parsing erros

func (Number) Abs

func (n Number) Abs() Number

Abs returns the absolute value of the number

func (Number) Acos

func (n Number) Acos() Number

Acos returns the acos of the number in degrees

func (Number) Add

func (n Number) Add(m Number) Number

Add adds two numbers

func (Number) Asin

func (n Number) Asin() Number

Asin returns the asin of the number in degrees

func (Number) Atan

func (n Number) Atan() Number

Atan returns the atan of the number in degrees

func (Number) Cos

func (n Number) Cos() Number

Cos returns the cos of the number (in degrees)

func (Number) Div

func (n Number) Div(m Number) (Number, error)

Div divides two numbers

func (Number) Factorial added in v0.1.0

func (n Number) Factorial() Number

Factorial computes the factorial (!)

func (Number) Float32 added in v0.0.34

func (n Number) Float32() float32

Float32 returns the value of the number as float

func (Number) Float64

func (n Number) Float64() float64

Float64 returns the value of the number as float

func (Number) Int

func (n Number) Int() int

Int returns the value of the number as int

func (Number) Mod

func (n Number) Mod(m Number) (Number, error)

Mod returns the modulus of the number

func (Number) Mul

func (n Number) Mul(m Number) Number

Mul multiplicates two numbers

func (Number) Pow

func (n Number) Pow(m Number) Number

Pow exponentiates the number

func (Number) Sin

func (n Number) Sin() Number

Sin returns the sin of the number (in degrees)

func (Number) Sqrt

func (n Number) Sqrt() Number

Sqrt returns the square root of the number

func (Number) String

func (n Number) String() string

String returns the value of the number as string

func (Number) Sub

func (n Number) Sub(m Number) Number

Sub substracts two numbers

func (Number) Tan

func (n Number) Tan() Number

Tan returns the tan of the number (in degrees)

Jump to

Keyboard shortcuts

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