Specifications

Apple IIGS
#79: Integer Math Data Types 1 of 2
Apple II
Technical Notes
Developer Technical Support
®
Apple IIGS
#79: Integer Math Data Types
Revised by: Jim Luther May 1990
Written by: Dan Strnad March 1990
This Technical Note describes the format of Fixed and Frac data types used by the Integer
Math tool set and operations performed on the Integer Math numerical data types.
Revised since March 1990: Fixed original date, bit numbering of diagrams, and a
multiplication sign in the equation.
As stated in Volume 1 of the Apple IIGS Technical Reference, the Integer Math tool set provides
the following numerical data types:
Integers
Longints
Fixed
Frac
Extended
The precise format of the Fixed and Frac data types is not provided in the reference manual,
so this Note details these formats.
The format for the Fixed data type is stated in the manual as being a 32-bit signed value with
16 bits of fraction. This means that the low-order 16 bits of the Fixed format data value are
considered as a fraction of 2^16, which is the binary number represented by a one followed by
16 zeroes ($10000). In other words, a Fixed value is the same as a long integer value whose
binary point has been moved to the left 16 places. In this representation, if the low-order part of
the Fixed format data value were $8000, the fractional value would be equal to 1/2. A low-
order part of $C000 would represent a fractional part equal to 3/4. Therefore the highest value
that a Fixed can contain is 32,767 and 65,535/65,536; the least value is equal to -32768.