zstdzgo.at/zstd/zfloat Index | Files

package zfloat

import "zgo.at/zstd/zfloat"

Package zfloat implements functions for floats.

Index

Functions

func IsSignedZero

func IsSignedZero(f float64) bool

IsSignedZero checks if this number is a signed zero (i.e. -0, instead of +0).

func Join

func Join(nums []float64, sep string) string

Join a float with the given separator.

func Limit

func Limit(v, lower, upper float64) float64

Limit a value between a lower and upper limit.

func RoundTo

func RoundTo(f float64, precision int) float64

RoundTo rounds the value to the given precision.

e.g. RoundTo(7.258, 2) will return 7.26

func Split

func Split(s, sep string) ([]float64, error)

Split converts a string of numbers to a []float64.

Types

type Byte

type Byte float64

Byte is a float64 where the String() method prints out a human-redable description.

func (Byte) String

func (b Byte) String() string

Source Files

zfloat.go

Version
v0.0.0-20240930202209-a63c3335042a (latest)
Published
Sep 30, 2024
Platform
linux/amd64
Imports
4 packages
Last checked
2 days ago

Tools for package owners.