Never include commas, dollar signs, or formatting symbols when specifying numbers. Only the digits 0-9 and the characters +, -, and the decimal point are valid numeric symbols (exponential notation also uses the letter “E” or “e”).

The manner in which integers and floats are stored and manipulated by computers limits their maximum range and precision.

Director performs all floating-point calculations to 15 significant digits. Floating-point values are never *permanently* rounded, but are merely *displayed* rounded to the number of decimal places specified by `the floatPrecision`

. Refer to "*Float Truncation*" later in this chapter for tips on avoiding errors due to the quirks of floating-point math.

set the floatPrecision = 4 put pi -- 3.1416 set the floatPrecision = 15 put pi -- 3.141592653589790 put 5.12345678901234567 -- 5.123456789012350

The maximum floating-point number is approximately +/-1.797693135e+308. Larger numbers return INF (on Macintosh) or -INF (under Windows) to indicate infinity.

put 2e+308-- Number is greater than max float-- INF put log (0) -- INF

Attempting an invalid calculation may return a meaningless value.

put log(-1) -- NAN-- Macintoshput log(-1) -- 0.0000000000e+0-- Windows

`The maxInteger`

returns the maximum positive integer (2147483647, which equals 2^{31}−1). The minimum integer is −2147483648 (Macintosh) or −2147483647 (Windows). *Adding* to `the maxInteger`

or *subtracting* from the ...

Start Free Trial

No credit card required