f32

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Functions for operating on 32bit floats, mostly just wrappers around the functions from std/math

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x float32) float32

Returns the absoulate value of x.

func Acos

func Acos(x float32) float32

Returns the arccosine, in radians, of x.

func ApproxEq

func ApproxEq(p, q, eps float32) bool

Returns whether the difference between p and q is less than eps

func Asin

func Asin(x float32) float32

Returns the arcsine, in radians, of x.

func Atan

func Atan(x float32) float32

Returns the arctangent, in radians, of x.

func Ceil

func Ceil(x float32) float32

Returns the least integer value greather than or equal to x.

func Cos

func Cos(x float32) float32

Returns the cosine of the radian argument x.

func Floor

func Floor(x float32) float32

Returns the greatest integer value less than or equal to x

func Hypot

func Hypot(p, q float32) float32

Returns Sqrt(p*p + q*q)

func Inf

func Inf(sign int) float32

Returns positive infinity if sign >= 0, negative infinity if sign < 0.

func IsInf

func IsInf(f float32, sign int) bool

Reports whether f is an infinity according to sign. sign > 0 reports x == +Inf sign < 0 reports x == -Inf sign == 0 reports x == +Inf || x == -Inf

func IsNaN

func IsNaN(f float32) bool

Reports whether f is NaN

func Max

func Max(args ...float32) float32

Returns the maximum value of the arguments If any argument is NaN, Max returns NaN

func Min

func Min(args ...float32) float32

Returns the minimum value of the arguments If any argument is NaN, Min returns NaN

func NaN

func NaN() float32

Returns a NaN value

func Pow

func Pow(x, y float32) float32

Returns x**y, the base-x exponential of y

func Round

func Round(x float32) float32

Returns the nearest integer, rounding half away from zero

func Sin

func Sin(x float32) float32

Returns the sine of the radian argument x

func Sqrt

func Sqrt(x float32) float32

Returns the square root of x

func Sum

func Sum(vals []float32) float32

Sums `vals` using pairwise summation to reduce round-off error

func Tan

func Tan(x float32) float32

Returns the tangent of the radian argument x

Types

This section is empty.

Jump to

Keyboard shortcuts

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