coremath

package
v0.0.0-...-c555478 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "math"
)

Variables

This section is empty.

Functions

func FortyTwo

func FortyTwo(sig *types.Type, input []types.Value) (types.Value, error)

FortyTwo returns 42 as either an int or a float. This is not especially useful, but was built for a fun test case of a simple poly function with two different return types, but no input args.

func Mod

func Mod(input []types.Value) (types.Value, error)

Mod returns mod(x, y), the remainder of x/y. The two values must be either both of KindInt or both of KindFloat, and it will return the same kind. If you pass in a divisor of zero, this will error, eg: mod(x, 0) = NaN. TODO: consider returning zero instead of erroring?

func Pow

func Pow(input []types.Value) (types.Value, error)

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

func Sqrt

func Sqrt(input []types.Value) (types.Value, error)

Sqrt returns sqrt(x), 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