AT&T 6300 Programmer's Manual page 75

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Variable Types
INTEGER DIVISION AND
MODULUS ARITHMETIC
Two additional operators are available in
GWBASIC: integer division and modulus
arithmetic.
Integer division is denoted by the backslash
(\). The operands are rounded to integers
before· the division is performed, and the
quotient is truncated to an integer. The
operands must be within the range -32768 to
32767.
Example:
x=10\4
PRINT x
2
Ok
Integer division follows multiplication and
floating-point division in order of precedence.
Modulus arithmetic is denoted by the operator
MOD. Modulus arithmetic yields the integer
value that is the remainder of an integer
division.
Example:
PRINT 10.4 MOD 4
2
Ok
PRINT 25.68 MOD 6.99
5
Ok
Modulus arithmetic follows integer division in
order of precedence.
3-17

Advertisement

Table of Contents
loading

Table of Contents