math

package
v0.0.0-...-622b233 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAbsoluteValueAsFloat64

func GetAbsoluteValueAsFloat64(number interface{}) float64

func GetAbsoluteValueAsInt

func GetAbsoluteValueAsInt(number interface{}) int

func IsFloatEffectivelyEqual

func IsFloatEffectivelyEqual(firstNumber, secondNumber float64) bool

IsFloatEffectivelyEqual This method allows you to check if two floating point numbers are effectively equal to each other. Since floating point operations perform approximate arithmetic, it is normal that there will be an accumulation of rounding errors in floating-point operations. By using this method, you can check if your numbers are for most practical purposes, equal or not by automatically rounding numbers down to 7 places.

func IsNumberEven

func IsNumberEven(number interface{}) bool

func RoundToDecimal

func RoundToDecimal(number interface{}, numberOfPlaces int) float64

func RoundToWholeNumber

func RoundToWholeNumber(number interface{}) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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