math

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package math contains wdte.Funcs for performing mathematical operations.

Index

Constants

View Source
const (
	E     wdte.Number = math.E
	Pi    wdte.Number = math.Pi
	Sqrt2 wdte.Number = math.Sqrt2
)

A number of useful constants. To see the IDs under which they are exported, see Scope.

Variables

View Source
var Scope = wdte.S().Map(map[wdte.ID]wdte.Func{
	"e":     E,
	"pi":    Pi,
	"sqrt2": Sqrt2,

	"sin": wdte.GoFunc(Sin),
	"cos": wdte.GoFunc(Cos),
	"tan": wdte.GoFunc(Tan),

	"floor": wdte.GoFunc(Floor),
	"ceil":  wdte.GoFunc(Ceil),
	"abs":   wdte.GoFunc(Abs),
})

Scope is a scope that contains the functions in this package.

Functions

func Abs

func Abs(frame wdte.Frame, args ...wdte.Func) wdte.Func

Abs is a WDTE function with the following signature:

abs n

Returns |n|.

func Ceil

func Ceil(frame wdte.Frame, args ...wdte.Func) wdte.Func

Ceil is a WDTE function with the following signature:

ceil n

Returns ⌈n⌉.

func Cos

func Cos(frame wdte.Frame, args ...wdte.Func) wdte.Func

Cos is a WDTE function with the following signature:

cos n

Returns the cosine of n.

func Floor

func Floor(frame wdte.Frame, args ...wdte.Func) wdte.Func

Floor is a WDTE function with the following signature:

floor n

Returns ⌊n⌋.

func Sin

func Sin(frame wdte.Frame, args ...wdte.Func) wdte.Func

Sin is a WDTE function with the following signature:

sin n

Returns the sine of n.

func Tan

func Tan(frame wdte.Frame, args ...wdte.Func) wdte.Func

Tan is a WDTE function with the following signature:

tan n

Returns the tangent of n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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