O'Reilly logo

Lingo in a Nutshell by Bruce A. Epstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Math Functions

Director supports the usual complement of math functions, as shown in Table 8-2. Refer to Table 8-3 and Table 8-4 for exponentiation and trigonometric functions.

Table 8-2. Math Functions

Lingo Keyword

Usage and Range

[a]
[b]
[c]

abs()

Calculates the absolute value of a number. Returns float or integer. Used to calculate unsigned values, such as distances.

add()

The add command pertains only to lists and is not a mathematical function. See the “+” operator.

charToNum()[a]

Converts ASCII character to ASCII code. See numToChar().

FALSE

Constant equivalent to zero (0). See TRUE.

float()

Converts string or integer to floating-point value. See the floatPrecision.

floatP()

Returns TRUE if operand is a floating-point value.

the floatPrecision[b]

Determines the number of decimal places used to display floats (default is 4). Does not affect calculation accuracy.

INF or -INF[b]

Indicates an overflow condition caused by a number larger than maximum allowed float or an undefined value.

integer()

Rounds floats to the nearest integer. integer(-.5) is rounded to −1, not zero. Use value() to convert strings first.

integerP()

Returns TRUE if operand is an integer.

max()

Returns maximum number from a list or comma-delimited series. Also works with strings.

the maxInteger[b]

Returns the maximum supported integer (2147483647), which equals 231−1.

min()

Returns minimum number from a list or comma-delimited series. Also works with strings.

mod

Modulo division ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required