Version: v0.0.0-...-c069387 Latest Latest

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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
t or T : Toggle theme light dark auto
y or Y : Canonical URL