Compiled Programs
◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Compiled Programs
■ Files with the .EXE extension contain more efficient code that may change
the way single- and double-precision values are compared. For example, the
following code prints "Equal" when run in the programming environment, but
prints "Not Equal" when compiled:
B! = 1.0
A! = B!/3.0
IF A! = B!/3.0 THEN PRINT "Equal" ELSE PRINT "Not Equal"
■ Because the compiled version makes more extensive use of a math
coprocessor chip (or coprocessor emulation), A! and B!/3.0 are slightly
different values. You can avoid problems in comparisons by performing
calculations outside comparisons. The following rewritten code produces
the same results, whether you run it under the programming environment
or compile it:
B! = 1.0
A! = B!/3.0
Tmp! = B!/3.0
IF A! = Tmp! THEN PRINT "Equal" ELSE PRINT "Not Equal"
See: ◄Creating EXE Files►
◄Basic Data Types Summary►
◄Expressions and Operators Summary►