Numeric Data Types

ViviFire supplies many numeric data types to use numbers with different formats. Integer types show as whole numbers, while non-integer types can show numbers with a fractional part.

To compare all the ViviFire data types, see Data Type Summary.

Integer types

The signed integer data types are as follows:

The unsigned integer data types are as follows:

Performance

Arithmetic operations are faster with integer types than with other data types.

Large integers

TODO

Small integers

If the full range of Int32 is more than what is necessary, Int16 is a possible alternative. The type Int16 holds integer values in the range −32,768 thru 32,767. For the smallest integer range, the type Int8 holds values from −128 thru 127.

Some code uses a large number of variables to hold small integers. If your code uses the types Int16 and Int8 for its variables, the runtime can possibly decrease the memory used. But operations with Int16 and Int8 are usually slower than with Int32.

Unsigned integers

If you know that a variable must not hold a negative value, the unsigned types are available. The unsigned types are UInt8, UInt16, UInt32, UInt64, and UInt128. Each of these data types can hold a positive integer two times larger than the related signed type (Int8, Int16, Int32, Int64, and Int128). The performance of each unsigned type is the same as the related signed type. Thus, UInt32 and Int32 have the same performance.

Non-integer types

The non-integer numeric data types are as follows:

Performance

TODO

Small magnitudes

TODO

Small fractional numbers

TODO

See also