home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / bp_6_93 / bonus / winer / chap8-6.bas < prev    next >
BASIC Source File  |  1992-05-12  |  324b  |  19 lines

  1. '*********** CHAP8-6.BAS - illustrates floating point 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 Value! = Result! THEN
  14.   PRINT "They are equal"
  15. ELSE
  16.   PRINT "Value! ="; Value!
  17.   PRINT "Result! ="; Result!
  18. END IF
  19.