math

package
v0.0.0-...-093b764 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64Calculator

type Float64Calculator struct{}

func NewFloat64Calculator

func NewFloat64Calculator() *Float64Calculator

NewFloat64Calculator returns a float64 calculator for basic operations without losing precision in decimals.

func (*Float64Calculator) Add

func (fc *Float64Calculator) Add(a, b float64) float64

Add returns a + b.

func (*Float64Calculator) DecimalPlaces

func (fc *Float64Calculator) DecimalPlaces(x float64) int

DecimalPlaces returns the number of decimal places.

func (*Float64Calculator) Div

func (fc *Float64Calculator) Div(a, b float64) float64

Div returns a / b.

func (*Float64Calculator) Max

func (fc *Float64Calculator) Max(x, y int) int

Max returns the larger of x or y.

func (*Float64Calculator) Mod

func (fc *Float64Calculator) Mod(a, b float64) float64

Mod returns a % b.

func (*Float64Calculator) Mul

func (fc *Float64Calculator) Mul(a, b float64) float64

Mul returns a * b.

func (*Float64Calculator) Sub

func (fc *Float64Calculator) Sub(a, b float64) float64

Sub returns a - b.

Jump to

Keyboard shortcuts

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