Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sunybcs!uhura.cc.rochester.edu!lowj_ltd From: lowj_ltd@uhura.cc.rochester.edu (John Alan Low) Newsgroups: comp.lang.pascal Subject: Problem in Turbo Pascal 4.0 Keywords: Nonterminating Repeat loop Message-ID: <4658@ur-cc.UUCP> Date: 30 Dec 89 07:13:25 GMT Reply-To: lowj_ltd@uhura.cc.rochester.edu (John Alan Low, aka "Travis" Low) Followup-To: comp.lang.pascal Organization: University of Rochester Lines: 22 I am having a problem with Turbo Pascal 4.0. The repeat loop in the following loop never terminates. Program Foo; var x : real; Begin x := 0.10; Repeat x := x + 0.01; Until x = 0.30; End. The Boolean expression is never true. I inserted a writeln(x) and watched as it took on values .... 0.28, 0.29, 0.30, 0.31, ... I inserted a writeln(x = 0.30) and it was always FALSE. What the heck is wrong here? Any ideas? I solved the problem by multiplying x by 10 and truncating, and testing to see if it was equal to 3, but geez, how ridiculous. ---Travis Ich suche die Leidenschaft, die keine Leiden schafft.