moremath

package
v0.0.0-...-4e1a221 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WasmCompatMax

func WasmCompatMax(x, y float64) float64

WasmCompatMax is the Wasm spec compatible variant of math.Max

This returns math.NaN if either parameter is math.NaN, even if the other is math.Inf.

See https://github.com/golang/go/blob/1d20a362d0ca4898d77865e314ef6f73582daef0/src/math/dim.go#L42-L59

func WasmCompatMin

func WasmCompatMin(x, y float64) float64

WasmCompatMin is the Wasm spec compatible variant of math.Min

This returns math.NaN if either parameter is math.NaN, even if the other is -math.Inf.

See https://github.com/golang/go/blob/1d20a362d0ca4898d77865e314ef6f73582daef0/src/math/dim.go#L74-L91

func WasmCompatNearestF32

func WasmCompatNearestF32(f float32) float32

WasmCompatNearestF32 is the Wasm spec compatible variant of math.Round, used for Nearest instruction. For example, this converts 1.9 to 2.0, and this has the semantics of LLVM's rint intrinsic.

Ex. math.Round(-4.5) results in -5 while this results in -4.

See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic.

func WasmCompatNearestF64

func WasmCompatNearestF64(f float64) float64

WasmCompatNearestF64 is the Wasm spec compatible variant of math.Round, used for Nearest instruction. For example, this converts 1.9 to 2.0, and this has the semantics of LLVM's rint intrinsic.

Ex. math.Round(-4.5) results in -5 while this results in -4.

See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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