Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!rpi!uwm.edu!psuvax1!psuvm!dbh106 From: DBH106@psuvm.psu.edu Newsgroups: comp.lang.pascal Subject: Re: Is this a bug in TurboPascal Message-ID: <91121.101409DBH106@psuvm.psu.edu> Date: 1 May 91 14:14:09 GMT References: <1991May1.021059.2129@ux1.cso.uiuc.edu> Organization: Penn State University Lines: 13 When you use integers, you must be aware that the highest value an integer can have is 32767. The program you posted multiplied 300 * 639 {xx} / 639. First, 300 is multiplied by 639, resulting in 191700. This is the error. If you had the Range Checking flag on you would have got a run time error. With it off, you get (I think) -4908. Then the division results in -7.68... . the Trunc function gives -7 as the answer. The other bad input is the same problem, I believe. One suggestion. When first writing a program, set all the compiler option flags. Dan Harter DBH106@psuvm.psu.edu