math32

package
v0.0.0-...-5f3c121 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 1 Imported by: 8

README

math32

One of the annoyances of Go is that its standard math library does only float64 arithmetic. Since Go has no implicit numerical conversions, using that library for 32-bit work is tedious.

The library here also adds a function Round that rounds to the nearest integer, with ties resolved as "round to even".

The library here corresponds to only a subset of the standard library. It may grow over time.

Documentation

Overview

Package math32 implements math functions on float32.

Index

Constants

View Source
const Pi = math.Pi

Variables

This section is empty.

Functions

func Abs

func Abs(x float32) float32

func Atan2

func Atan2(y float32, x float32) float32

func Cos

func Cos(x float32) float32

func Exp

func Exp(x float32) float32

func Hypot

func Hypot(x float32, y float32) float32

func Max

func Max(a, b float32) float32

func Min

func Min(a, b float32) float32

func Round

func Round(x float32) float32

Round 32-bit float to the nearest integer value, rounding to even in case of a tie. Sadly there is no analogue of this function in the Go math library.

func Signbit

func Signbit(x float32) bool

func Sin

func Sin(x float32) float32

func Sincos

func Sincos(θ float32) (sin, cos float32)

func Sqrt

func Sqrt(x float32) float32

func Trunc

func Trunc(x float32) float32

Types

This section is empty.

Jump to

Keyboard shortcuts

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