[fpc-devel]bug or feature?

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sun Feb 4 12:23:59 CET 2001


On Sat, 3 Feb 2001, òÏÍÁÎ èÌÙÎÏ×ÓËÉÊ wrote:

> Hello, i'm not subscribed to fpc's mailing list, so it would be great if answer 
> would be forwarded to my e-mail. the problem is:
> ------------------------------------------------------------
> [dr at dr.lnx.home.kz][dr]$> cat d.pas                                        
> begin
> writeln(round(9/2));
> end.
> [dr at dr.lnx.home.kz][dr]$> fpc d.pas
> Free Pascal Compiler version 1.0.4 [2000/12/18] for i386
> Copyright (c) 1993-2000 by Florian Klaempfl
> Target OS: Linux for i386
> Compiling d.pas
> Assembling program
> Linking d
> 3 Lines compiled, 1.7 sec
> [dr at dr.lnx.home.kz][dr]$> ./d
> 4
> [dr at dr.lnx.home.kz][dr]$> fpc -So d.pas
> Free Pascal Compiler version 1.0.4 [2000/12/18] for i386
> Copyright (c) 1993-2000 by Florian Klaempfl
> Target OS: Linux for i386
> Compiling d.pas
> Assembling program
> Linking d
> 3 Lines compiled, 1.6 sec
> [dr at dr.lnx.home.kz][dr]$> ./d
> 4
> [dr at dr.lnx.home.kz][dr]$>
> ------------------------------------------------------------
> afair round() should round values, but not truncate.

It works correctly, it does the same as Delphi:

home: >dcc  testr.pp
home: >testr
4
home: > 

Rounding up happens for 4.51; till 4.5, round goes down.

Michael.





More information about the fpc-devel mailing list