|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles Qt Script for Applications

[Prev: Function Type] [Home] [Next: Object]

Number

A Number is a datatype that represents a number. In most sittuations, programmers will use numeric literals like 3.142 directly in code. The Number datatype is useful for obtaining system limits, e.g. MIN_VALUE and MAX_VALUE, and for performing number to string conversions with toString()

Number Construction

Numbers are not normally constructed, but instead created by simple assignment, e.g.

    var x = 3.142;
Number Properties
    System.println( Number.MAX_VALUE );
    System.println( Number.MIN_VALUE );

The maximum and minimum values are floating point values.

A numeric variable may hold a non-numeric value, in which case isNaN() returns true. The result of an arithmetic expression may exceed the maximum or minimum representable values in which case the value of the expression will be Infinity, and isFinite() will return false.

Number Functions
toString toString()

Returns the number as a string value.

[Prev: Function Type] [Home] [Next: Object]


Copyright © 2001-2003 TrolltechTrademarks
QSA version 1.0.0