Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
On 02/10/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: But 0.125 and 0.375 are representable ACCURATELY on a computer, aren't they? Vincent Yes they can, so FPC still has a bug in Banker's Rounding. What is really interresting is that I never really thought about irrational number and how

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Vincent Snijders
Chris Cheney schreef: Date sent: Mon, 2 Oct 2006 12:59:45 +0200 From: "Graeme Geldenhuys" <[EMAIL PROTECTED]> To: "FPC developers' list" Subject: Re: [fpc-devel] Rounding inconsistent (critic

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Chris Cheney
Date sent: Mon, 2 Oct 2006 12:59:45 +0200 From: "Graeme Geldenhuys" <[EMAIL PROTECTED]> To: "FPC developers' list" Subject: Re: [fpc-devel] Rounding inconsistent (critical) Send reply to

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
I also ran the exact example given on the Wikipedia site and I also got errors. AssertEquals('Failing on 1', '3.02', FormatFloat('0.00', 3.016)); AssertEquals('Failing on 2', '3.01', FormatFloat('0.00', 3.013)); AssertEquals('Failing on 3', '3.02', FormatFloat('0.00', 3.015)); AssertEquals('F

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
On 02/10/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: > AssertEquals('Failing on 10', '0.44', FormatFloat('0.00', 0.445)); > AssertEquals('Failing on 11', '0.46', FormatFloat('0.00', 0.455)); Sorry, I shouldn't have used the work expected in my description, as that does confuse things a bi

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Vincent Snijders
Graeme Geldenhuys schreef: On 02/10/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: It is not a bug, it is using bankers rounding. See http://lazarus-ccr.sourceforge.net/docs/rtl/system/round.html Vincent Exactly, but it is still wrong, except if I really don't know how Banker's rounding work

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
Oh, I followed the rules as define for Banker's Rounding (round-to-even) show on Wikipedia http://en.wikipedia.org/wiki/Rounding Use that to round 0.445 and 0.455. I gather that Delphi 7 defaults to Common Rounding and not Banker's Rounding. Should FPC follow the Delphi rules on this to stay c

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
On 02/10/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: It is not a bug, it is using bankers rounding. See http://lazarus-ccr.sourceforge.net/docs/rtl/system/round.html Vincent Exactly, but it is still wrong, except if I really don't know how Banker's rounding works and what they mean by Even

Re: [fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Vincent Snijders
Graeme Geldenhuys schreef: Hi, I created the follow fpcUnit tests. For those that don't know fpcUnit, the AssertEquals takes three parameters: Failing message, Expected Value, Actual Value. Now from the tests below, I am formatting all values to 2 decimal values. I expected all tests to pass,

[fpc-devel] Rounding inconsistent (critical)

2006-10-02 Thread Graeme Geldenhuys
Hi, I created the follow fpcUnit tests. For those that don't know fpcUnit, the AssertEquals takes three parameters: Failing message, Expected Value, Actual Value. Now from the tests below, I am formatting all values to 2 decimal values. I expected all tests to pass, but it doesn't. Test 9 fail