NeturalMath Language Definition and Syntax

Range Data Type

The Range data type represents a range of values from a minimum value to a maximum value. These values may be either bounded or limits. Boundedf values are inclusive to the range (will be included in caluclations using the range). Limits are values which are outside of the range, but define it's boundries. An item infinitely close to a limit is still inside the range, but the limit itself is not.

Ranges are not implemented in the current version of NeturalMath. It is planned to be implemented in v0.3.4. See Roadmap for more details.

Type information

The Range data type will return the String {'range'} when queried.
:> x = 1->10
:> numType = type(x)
:> print numType

'range'


If output, the range data type will return a literal representation of itself
:> x = 1->10
:> print x

1->10
:> y = (-1)->(1)
:> print y

(-1)->(1)

Operations

This section is not complete

Literals

Ranges are entered using two numeric values seperated by the single arrow ({->}) sign. This specifies the minimum and maximum values for a range. In order to specify a range as a limit, you must wrap the numeric value in parentheses. The left (minimum) value must always be smaller than the right (maximum) value.
:> a = 1->10       // a simple range of all values from one to ten
:> b = (1)->10     // a range with a lower limit of one, and an upper bound of ten
:> c = (1.5)->(10) // a range with lower limit of 1.5 and an upper limit of ten
:> d = -10->(13)  // a range with a lower bound of negative ten and and and upper limit of thirteen
:> e = -1->1        // a range with a lower bound of negative one and a upper bound of one

Conversions

Ranges exhibit the following behaviors when converted to other types:

Bool

This section is not complete

Complex

This section is not complete

Number

This section is not complete

Set

This section is not complete

String

This section is not complete

Units

This section is not complete

Functions

The following System Functions consume the Number data type:

Functions which only operate on Ranges

Functions which take ranges as parameters

This section is not complete

Functions which take any data type

See Also:

http://en.wikipedia.org/wiki/Limit_(mathematics)

Last edited Oct 14, 2010 at 3:08 PM by zanethorn, version 4

Comments

No comments yet.