integer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator struct{}

func (Calculator) Add

func (Calculator) Add(augend, addend int) int

func (Calculator) Compare

func (Calculator) Compare(a, b int) calculator.CompareResult

func (Calculator) Decrement

func (Calculator) Decrement(value int) int

Returns an decremented number.

@param value - The number to decrement.

@returns The decremented number.

func (Calculator) Increment

func (Calculator) Increment(value int) int

Returns an incremented number.

@param value - The number to increment.

@returns The incremented number.

func (Calculator) IntegerDivide

func (Calculator) IntegerDivide(dividend, divisor int) (int, error)

Returns the quotient of two numbers with no fractional part.

func (Calculator) Modulo

func (Calculator) Modulo(dividend, divisor int) (int, error)

Returns the modulous of two numbers.

func (Calculator) Multiply

func (Calculator) Multiply(multiplicand, multiplier int) int

Returns the product of two numbers.

@param multiplicand - The number to multiply. @param multiplier - The number to multiply with.

@returns The product of the two numbers.

func (Calculator) Power

func (c Calculator) Power(base, exponent int) int

Returns the product of two numbers. https://stackoverflow.com/a/71289792

func (Calculator) Subtract

func (Calculator) Subtract(minuend, subtrahend int) int

Returns the difference between two numbers.

@param minuend - The number to subtract from. @param subtrahend - The number to subtract.

@returns The difference of the two numbers.

func (Calculator) ToInt added in v1.0.0

func (Calculator) ToInt(v int) int

func (Calculator) ToString added in v1.0.0

func (Calculator) ToString(v int) string

func (Calculator) Zero

func (Calculator) Zero() int

Returns a value equal to 0.

Jump to

Keyboard shortcuts

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