home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / WINER.ZIP / CHAP8-7.BAS < prev    next >
BASIC Source File  |  1992-05-13  |  329b  |  19 lines

  1. '*********** CHAP8-7.BAS - shows how to avoid math rounding errors
  2.  
  3. 'Copyright (c) 1992 Ethan Winer
  4.  
  5. Value! = 1!
  6. Result! = 2!
  7. CLS
  8.  
  9. FOR X = 1 TO 1000
  10.   Value! = Value! + .001
  11. NEXT
  12.  
  13. IF ABS(Value! - Result!) < .0001 THEN
  14.   PRINT "They are equal"
  15. ELSE
  16.   PRINT "Value! ="; Value!
  17.   PRINT "Result! ="; Result!
  18. END IF
  19.