bas7qck.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Compiled Programs
  Relational Operators                         Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 
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 fragment prints Equal when run in the QBX 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 fragment produces the same
results whether you run it under QBX or compile it:
 
B!=1.0
A!=B!/3.0
Tmp!=B!/3.0
IF A!=Tmp! THEN PRINT "Equal" ELSE PRINT "Not Equal"