EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 604

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.