Prev | Current Page 85 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Double precision floating - point numbers also have the benefit of
being able to contain very large non - floating - point numbers, or Float s with a small decimal precision.
Integers
Integers are represented by the Int class. Ironically, the Int class extends the Float class in haXe. This is
because all integers are merely floating - point numbers with a zero precision mantissa (the right side of
the decimal point), while the reverse is not true, as converting a Float to an Int requires losing the
mantissa precision entirely.
Most scripting languages, including the Flash SWF specification and JavaScript, allow 32 bits for their
integers, which can store values of up to 2147483647 (2 31  1) or  2147483648 (  2 31 ). The integers are
signed, which means the most significant bit, the bit on the far left, is used to determine whether the
value is positive or negative. Neko, however, uses only 31 bits for its integers from a 32 - bit value, which
can store maximum values of 1073741823 (2 30 1) or  1073741824 (  2 30 ).


Pages:
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97