[Type] Num

Part of: mobl
Inherits from: mobl::Object

Represents numeric values (both integer and floating point). Maps directly to Javascript's numeric type and has same properties (in the sense of rounding errors in floating point arithmetic).

Instantiation

A new Num can be created by using literal numeric values.

Example:

var n = 8;
var f = 8.8;

Operators

+

Adds two numbers.

Example:

8 + 10 // -> 18

-

Subtracts two numbers.

Example:

8 - 10 // -> -2

*

Multiplies two numbers.

Example:

8 * 10 // -> 80

/

Divides two numbers.

Example:

8 / 10 // -> 0.8

%

Calculates the modulo of two numbers.

Example:

8 % 10 // -> 8
mobl/num.txt · Last modified: 2013/10/01 02:28 (external edit)