P-Code Instructions (pcode.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.
CmpT
                                              Up Contents Index Back
──P-Code Instructions───────────────────────────────────────────────────────
 
  Syntax
 
  CmpT
 
  /* Compare top two floating point values on floating point stack. */
 
  Description
 
  Compares two floating point values on the floating point stack in
  ten-byte real format.
 
  The evaluation stack is updated with a -1, 0, or 1, followed by a 0,
  depending on the results of the unsigned compare.
 
  Pseudocode equivalent:
 
  t2 = PopT();
  t1 = PopT();
  Push(t1 == t2 ? 0 : (t1 > t2) ? 1 : -1);
  Push(0);
 
  The following code fragment shows how this instruction is generated:
 
  Test1 = 99.00;
  Test2 = Test1 + 10000.00;
  if (Test2 > 10098.00)    /* generates CmpT */
 
 
                                     -♦-