num

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package num offers helpers for working with numbers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Between

func Between[T constraints.Ordered](v, lower, upper T) bool

Between returns true if x >= lower and x <= upper.

func NN

func NN(x, y float64) float64

NN (Not Number) returns y if x is NaN or Inf.

func NNZ

func NNZ(x, y float64) float64

NNZ (Not Number or Zero) returns y if x is NaN or Inf or Zero.

func Round2DP

func Round2DP(x float64) float64

Round2DP rounds x to 2 decimal places.

func RoundTo

func RoundTo(x, y float64) float64

RoundTo rounds x to the nearest y precision.

Types

This section is empty.

Jump to

Keyboard shortcuts

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