604
Chapter 13: Operators
/ (division)
Usage
-- Lingo syntax
expression1
/
expression2
// JavaScript syntax
expression1
/
expression2
Description
Math operator; performs an arithmetic division on two numerical expressions, dividing
expression1
by
expression2
. If both expressions are integers, the quotient is an integer. If
either or both expressions are floating-point numbers, the quotient is a floating-point number.
This is an arithmetic operator with a precedence level of 4.
Example
This statement divides the integer 22 by 7 and then displays the result in the Message window:
-- Lingo syntax
put(22 / 7)
// JavaScript syntax
put(22 / 7);
The result is 3. Because both numbers in the division are integers, Lingo rounds the answer down
to the nearest integer.
This statement divides the floating-point number 22.0 by 7.0 and then displays the result in the
Message window:
-- Lingo syntax
put(22.0 / 7.0)
// JavaScript syntax
put(22.0 / 7.0);
The result is 3.1429, which is a floating-point number.
/ (division) (3D)
Usage
-- Lingo syntax
vector
/
scalar
// JavaScript syntax
vector
/
scalar
Description
3D vector operator; divides each of the vector components by the scalar value and returns a
new vector.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...