imath

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxInt8   = 1<<7 - 1
	MinInt8   = -1 << 7
	MaxInt16  = 1<<15 - 1
	MinInt16  = -1 << 15
	MaxInt32  = 1<<31 - 1
	MinInt32  = -1 << 31
	MaxInt64  = 1<<63 - 1
	MinInt64  = -1 << 63
	MaxUint8  = 1<<8 - 1
	MaxUint16 = 1<<16 - 1
	MaxUint32 = 1<<32 - 1
	MaxUint64 = 1<<64 - 1
)

Integer limit values.

Variables

This section is empty.

Functions

func Abs

func Abs(x int) int

Abs returns the absolute value of x.

func Cbrt

func Cbrt(x int) int

Cbrt returns the cube root of x.

func Copysign

func Copysign(x, y int) int

Copysign returns a value with the magnitude of x and the sign of y.

func Dim

func Dim(x, y int) int

Dim returns the maximum of x-y or 0.

func Exp2

func Exp2(x int) int

Exp2 returns 2**x, the base-2 exponential of x.

func Hypot

func Hypot(p, q int) int

Hypot returns Sqrt(p*p + q*q), taking care to avoid unnecessary overflow and underflow.

func Intbits

func Intbits(i int) uint

Intbits return the binary representation of i.

func Intfrombits

func Intfrombits(b uint) int

Intfrombits returns the int represented from b.

func Log

func Log(x int) int

Log returns the natural logarithm of x.

func Max

func Max(x, y int) int

Max returns the larger of x or y.

func Min

func Min(x, y int) int

Min returns the smaller of x or y.

func Mod

func Mod(x, y int) int

Mod returns the x%y.

func Nextafter

func Nextafter(x, y int) (r int)

Nextafter returns the next representable int value after x towards y.

func Pow

func Pow(x, y int) int

Pow returns x**y, the base-x exponential of y.

func Pow10

func Pow10(e int) int

Pow10 returns 10**e, the base-10 exponential of e.

func Signbit

func Signbit(x int) bool

Signbit returns true if x is negative or negative zero.

func Sqrt

func Sqrt(x int) int

Sqrt returns the square root of x.

Types

This section is empty.

Jump to

Keyboard shortcuts

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