f64

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

README

f64

Purpose

Utilities for float64. Mainly random value generation.

Documentation

On time

In source code (see releases in repository).

Elegant. Possibly outdated.

github.com/Siiir/f64 v1

Repository

https://github.com/Siiir/f64

Documentation

Overview

Utilities for float64.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rand

func Rand() float64

Returns completly random float64. Might be abnormal or special.

Example
for i := 10; i > 0; i-- {
	for i := 5; i > 0; i-- {
		print(Rand(), "\t")
	}
	println()
}
//:-) Output:
Output:

func RandNormal

func RandNormal() float64

Returns random, not-abnormal, not-special (not NaN, not Inf), `float64`

Example
for i := 10; i > 0; i-- {
	for i := 5; i > 0; i-- {
		print(RandNormal(), "\t")
	}
	println()
}
//:-) Output:
Output:

func ValEquivalence

func ValEquivalence(fl1, fl2 float64) bool

Description:

return (math.IsNaN(fl1) && math.IsNaN(fl2)) || fl1 == fl2

func WithRandSign

func WithRandSign(fl float64) float64

Returns either `fl` or `-fl` .

Example
for i := 10; i > 0; i-- {
	for i := 5; i > 0; i-- {
		print(WithRandSign(rand.Float64()), "\t")
	}
	println()
}
//:-) Output:
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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