NeturalMath Language Definition and Syntax

Unit Data Type

The Unit data type is a representation of a measurable value. Units represent a single numeric value, combined with a (potentially) complex series of measurements. For example, a unit could represent a simple value such as inches (in), a relationship such as miles per hour (mph) or a very complex relationship such as square meters per second squared (m2/s2). Units are highly useful for solving scientific and engineering problems.

Units may be defined in terms of distance, time, temperature

Units are not implmented in the current version of NeturalMath. They are planned for implementation in v 0.3.5. Please see Roadmap for more details.

Type information

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


Additional information about a unit's measurement type can be obtained with the unittype function.
:> x = unit(10,'in')
:> print utype(x)


If output, the unit type will return a string representation of both the value and the unit type
:> x = unit(10,'in')
:> print x

:> y = unit(3,'s')
:> print y


If the numeric value of a unit may be captured by calling the value function, or by converting the unit to a number.
:> x = unit(10,'in')
:> print value(x)

:> y = unit(3,'s')
:> print value(y)



This section is not complete


There is currently no support for inputing a unit as a literal. Units are defined by calling the unit function and providing an initial value and a unit type.


Units exhibit the following behaviors when converted to other types:


This section is not complete


This section is not complete

RangeThis section is not complete


This section is not complete


This section is not complete


This section is not complete


The following System Functions consume the Unit data type:
This section is not complete

See Also:

Last edited Oct 14, 2010 at 2:36 PM by zanethorn, version 2


No comments yet.