Class: DefNumber

algeobra~DefNumber(val)

Definition of a simple number. Creates an object of TYPE_NUMBER

Constructor

new DefNumber(val)

Default value
Parameters:
Name Type Description
val Number The number
Source:

Methods

compute(createInfo) → {Object}

Creates the number
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
An object of TYPE_NUMBER or INVALID
Type
Object

(static) fromField(obj, key, transformopt) → {CreateInfo}

Extract a field from a given object and make a number out of it. If no such field exists, INVALID will be created
Parameters:
Name Type Attributes Default Description
obj Number | Object The object of which the value is extracted
key * The key
transform function <optional>
null A transform taking the value obj[key], if it exists and returns a new one
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromFunc(f, x) → {CreateInfo}

Create a number by computing the value of a given function and a parameter
Parameters:
Name Type Description
f function The function f(x) to compute
x Number | Object | Array.<Number> | Array.<Object> Either the indices or values of a TYPE_NUMBER. The parameters to f
Source:
Returns:
The creation info
Type
CreateInfo