numbers

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(v1, v2 interface{}) interface{}

Add v1 and v2 or return zero if type issue

func Addi

func Addi(v1, v2 interface{}) int

Addi adds two values return an int or zero

func Divide

func Divide(v1, v2 interface{}) interface{}

Divide v1 by v2 for non-zero v2 or return zero

func Float32

func Float32(v interface{}) float32

Float32 returns a float32 for value provided

func Float64

func Float64(v interface{}) float64

Float64 returns a float64 for value provided

func Int

func Int(v interface{}) int

Int returns a int for value provided

func Int64

func Int64(v interface{}) int64

Int64 returns an int64 for value provided

func IsNumber

func IsNumber(v interface{}) bool

IsNumber checks to see if the input type can render to a float64, float32, int64 or int

func IsZero

func IsZero(v interface{}) bool

IsZero checks to see if a Number is zero

func Modulo

func Modulo(v1, v2 interface{}) interface{}

Modulo returns the modulo of int or int64 or zero

func Multiply

func Multiply(v1, v2 interface{}) interface{}

Multiply v1 by v2 returning the result or zero if type issue

func Subi

func Subi(v1, v2 interface{}) int

Subi adds two values return an int or zero

func Subtract

func Subtract(v1, v2 interface{}) interface{}

Substract v2 from v1 or return zero if a type issue

Types

This section is empty.

Jump to

Keyboard shortcuts

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