Path: utzoo!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!osiris.cso.uiuc.edu!aindiana From: aindiana@osiris.cso.uiuc.edu (Daiv Stoner) Newsgroups: comp.lang.pascal Subject: TP 5.5 int() function Keywords: TP,Turbo,Pascal Message-ID: <1990Aug15.160719.12762@ux1.cso.uiuc.edu> Date: 15 Aug 90 16:07:19 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Distribution: comp Organization: University of Illinois at Urbana Lines: 35 A little technical question for all you net wizards. The following piece of code written and compiled in Turbo Pascal 5.5 on an IBM Model 50 gives strange results. Here's the code: program a; var rate,reg:real; x,value:real; begin rate:=2.01; reg:=12.5; value:=rate*reg*100+0.5; x := int(value)/100; writeln('rate=',rate:8:4,' reg=',reg:8:4,' total=',rate*reg:8:4,' x=',x:8:4); end. I get this output: rate= 2.0100 reg= 12.5000 total= 25.1250 x= 25.1200 Borland Tech. Support says "round-off" error. I say it's a bug. Any ideas? -- Daiv Stoner +===============================================+ aindiana@osiris.cso.uiuc.edu | I work for the Gov't. If I want your opinion | oinxds@ria-emh1.army.mil | I'll ask you to fill out the necessary forms. | Disclaimer: The Dept. of +===============================================+ Defense doesn't even know what it's doing, let alone what I'm doing.