math

package
v0.0.0-...-d63bf21 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Mathematical constants.

View Source
var Ceil = rnt.NewSimpleFunction("Ceil",
	[]string{"f"},
	func(args []rnt.Object) rnt.Object {
		f := args[0].(rnt.Float).Value()
		return rnt.NewInt(int(math.Ceil(f)))
	})

Ceil wraps math.Ceil.

View Source
var Log = rnt.NewSimpleFunction("Log",
	[]string{"f"},
	func(args []rnt.Object) rnt.Object {
		f := args[0].(rnt.Float).Value()
		l := math.Log(f)
		if math.IsNaN(l) || math.IsInf(l, 0) {
			panic(rnt.RaiseType(rnt.ValueErrorType, "math domain error"))
		}
		return rnt.NewFloat(l)
	})

Log wraps math.Log.

View Source
var MaxUInt = rnt.NewInt(int(^uint(0) >> 1))

MaxUInt is the bigest unsigned integer value representable on the current platform.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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