floats

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

package floats provides a standard Floater interface and all the std math functions

defined on Floater types. Furthermore, fully generic slice sort and conversion methods in the kit type kit package attempt to use this interface, before falling back on reflection. If you have a struct that can be converted into an float64, then this is the only way to allow it to be sorted using those generic functions, as the reflect.Kind fallback will fail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(x Floater) float64

func Acos

func Acos(x Floater) float64

func Acosh

func Acosh(x Floater) float64

func Asin

func Asin(x Floater) float64

func Asinh

func Asinh(x Floater) float64

func Atan

func Atan(x Floater) float64

func Atan2

func Atan2(y, x Floater) float64

func Atanh

func Atanh(x Floater) float64

func Cbrt

func Cbrt(x Floater) float64

func Ceil

func Ceil(x Floater) float64

func Copysign

func Copysign(x, y Floater) float64

func Cos

func Cos(x Floater) float64

func Cosh

func Cosh(x Floater) float64

func Dim

func Dim(x, y Floater) float64

func Erf

func Erf(x Floater) float64

func Erfc

func Erfc(x Floater) float64

func Erfcinv

func Erfcinv(x Floater) float64

func Erfinv

func Erfinv(x Floater) float64

func Exp

func Exp(x Floater) float64

func Exp2

func Exp2(x Floater) float64

func Expm1

func Expm1(x Floater) float64

func Floor

func Floor(x Floater) float64

func Frexp

func Frexp(f Floater) (frac float64, exp int)

func Gamma

func Gamma(x Floater) float64

func Hypot

func Hypot(p, q Floater) float64

func Ilogb

func Ilogb(x Floater) int

func IsInf

func IsInf(f Floater, sign int) bool

func IsNaN

func IsNaN(f Floater) (is bool)

func J0

func J0(x Floater) float64

func J1

func J1(x Floater) float64

func Jn

func Jn(n int, x Floater) float64

func Ldexp

func Ldexp(frac Floater, exp int) float64

func Lgamma

func Lgamma(x Floater) (lgamma float64, sign int)

func Log

func Log(x Floater) float64

func Log10

func Log10(x Floater) float64

func Log1p

func Log1p(x Floater) float64

func Log2

func Log2(x Floater) float64

func Logb

func Logb(x Floater) float64

func Max

func Max(x, y Floater) float64

func Min

func Min(x, y Floater) float64

func Mod

func Mod(x, y Floater) float64

func Modf

func Modf(f Floater) (int float64, frac float64)

func Nextafter

func Nextafter(x, y Floater) (r float64)

func Pow

func Pow(x, y Floater) float64

func Remainder

func Remainder(x, y Floater) float64

func Round

func Round(x Floater) float64

func RoundToEven

func RoundToEven(x Floater) float64

func Signbit

func Signbit(x Floater) bool

func Sin

func Sin(x Floater) float64

func Sincos

func Sincos(x Floater) (sin, cos float64)

func Sinh

func Sinh(x Floater) float64

func Sqrt

func Sqrt(x Floater) float64

func Tan

func Tan(x Floater) float64

func Tanh

func Tanh(x Floater) float64

func Trunc

func Trunc(x Floater) float64

func Y0

func Y0(x Floater) float64

func Y1

func Y1(x Floater) float64

func Yn

func Yn(n int, x Floater) float64

Types

type FloatSetter

type FloatSetter interface {
	Floater
	FromFloat(val float64)
}

FloatSetter is Floater that also supports setting the value from a float64. Satisfying this interface requires a pointer to the underlying type.

type Floater

type Floater interface {
	Float() float64
}

Floater converts a type from a float64, used in kit.ToFloat function and in sorting comparisons -- tried first in sorting

Jump to

Keyboard shortcuts

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