NeturalMath Language Definition and Syntax

Number Data Type

The Number data type is a representation of a real, calculatable number in NeturalMath. Internally, it makes us of the .NET System.Double data type. It has the same approximate capabilities and limitations as the {double} data type in C#.

Type information

The Number data type will return the String 'number' when queried.
:> x = 10
:> numType = type(x)
:> print numType

'number'


If output, the numberdata type will return its literal representation
:> x = 10
:> print x

10
:> y = -3.21
:> print y

-3.21

Literals

Literals are entered by keying in a standard decimal representation of a number. The number can contain an optional '+' or '-' sign, and may also contain a decimal point. The following are all numeric literals
:> a = 10
:> b = 10.0
:> c = -10.0
:> d = (-10)
:> e = -1.2345

Operators

This section is not complete

Conversions

Numbers exhibit the following behaviors when converted to other types:

Bool

If the number is non-zero, the bool will be true. If the number is zero, the bool will be false.
:> x = bool(10)
:> print x

true
:> y = bool(0)
:> print y

false

Complex

This section is not complete

Range

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:
This section is not complete

See Also:

This section is not complete

Last edited Oct 14, 2010 at 3:06 PM by zanethorn, version 6

Comments

No comments yet.