On 5/30/07, Jonas Maebe <[EMAIL PROTECTED]> wrote:
0.005, as extended, is actually 0.00499898356046329484
As double, it is actually 0.0050001
For now I have managed to implement a work-around in my code which
passes all unit tests I could throw at it.
I first look
On Wed, 30 May 2007, Graeme Geldenhuys wrote:
> On 5/30/07, Yury Sidorov <[EMAIL PROTECTED]> wrote:
> > > Yeah, that outputs the correct value here as well. Confirmed a bug
> > > then!
> >
> > Currency to string conversion is handled in other way that float
> > types. In original example extend
On 30 mei 2007, at 15:08, Graeme Geldenhuys wrote:
Yury, you are right! I never spotted that, thanks.
Running the example program below shows the difference in output. The
currency type rounds to 0.01 and the extended type rounds to 0.00.
Either way, I still believe this is a bug in FormatFlo
On 5/30/07, Yury Sidorov <[EMAIL PROTECTED]> wrote:
> Yeah, that outputs the correct value here as well. Confirmed a bug
> then!
Currency to string conversion is handled in other way that float
types. In original example extended type was used
Yury, you are right! I never spotted that,
From: "Graeme Geldenhuys" <[EMAIL PROTECTED]>
On 5/30/07, Jonas Maebe <[EMAIL PROTECTED]> wrote:
var
c: currency;
begin
c:=0.005;
writeln(c:0:2);
end.
writes 0.01. So it's probably a bug in one of the umpteen sysutils
float formatting "helpers" (and if someone fixes it, please take
i
On 5/30/07, Jonas Maebe <[EMAIL PROTECTED]> wrote:
var
c: currency;
begin
c:=0.005;
writeln(c:0:2);
end.
writes 0.01. So it's probably a bug in one of the umpteen sysutils
float formatting "helpers" (and if someone fixes it, please take into
Yeah, that outputs the correct value here
On 5/30/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
And that's all that can be found. So from this I conclude it's up to the CPU,
and furthermore you cannot assume anything about it since the behaviour
of the CPU is programmable with the abovementioned procedures.
(which are obviously not
On 30 mei 2007, at 11:56, Michael Van Canneyt wrote:
On Wed, 30 May 2007, Jonas Maebe wrote:
The writing of floating point values does not use the rounding
functionality
provided by the FPU, it is implemented in a completely cpu-
independent way.
Doesn't it use rounding ?
It does, but d
On Wed, 30 May 2007, Jonas Maebe wrote:
>
> On 30 mei 2007, at 11:10, Michael Van Canneyt wrote:
>
> >Not that I know of. As far as I know, it's left up to the CPU.
> >But it's been a long time since I looked at this, so I might
> >be wrong.
>
> The writing of floating point values does not u
On 30 mei 2007, at 11:10, Michael Van Canneyt wrote:
Not that I know of. As far as I know, it's left up to the CPU.
But it's been a long time since I looked at this, so I might
be wrong.
The writing of floating point values does not use the rounding
functionality provided by the FPU, it is
On Wed, 30 May 2007, Graeme Geldenhuys wrote:
> On 5/29/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
> > If I remember correctly:
> > Bookkeepers rounding as implemented by the Intel processors.
> > No own routines are used. It's left up to the processor.
>
>
> I thought FormatFloat() us
On 5/29/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:
If I remember correctly:
Bookkeepers rounding as implemented by the Intel processors.
No own routines are used. It's left up to the processor.
I thought FormatFloat() uses Common Rounding and FormatCurr() uses
Bankers Rounding. This w
Am Dienstag, 29. Mai 2007 20:51 schrieb Graeme Geldenhuys:
> On 5/29/07, Joao Morais <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > Attached is a application that demonstrates a bug in FormatFloat.
> > > All tests pass when run under Delphi, but test four fails under
> > > Free Pascal.
> >
> > I
On Tue, 29 May 2007, Graeme Geldenhuys wrote:
> On 5/29/07, Joao Morais <[EMAIL PROTECTED]> wrote:
> > Graeme Geldenhuys wrote:
> >
> > > Hi,
> > >
> > > Attached is a application that demonstrates a bug in FormatFloat. All
> > > tests pass when run under Delphi, but test four fails under Free
On 5/29/07, Joao Morais <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Attached is a application that demonstrates a bug in FormatFloat. All
> tests pass when run under Delphi, but test four fails under Free
> Pascal.
IMHO, fpc behaves correctly. 0.005 is closer than 0 instead 0.01. If you
try 0.0050
On 5/29/07, Joao Morais <[EMAIL PROTECTED]> wrote:
Graeme Geldenhuys wrote:
> Hi,
>
> Attached is a application that demonstrates a bug in FormatFloat. All
> tests pass when run under Delphi, but test four fails under Free
> Pascal.
IMHO, fpc behaves correctly. 0.005 is closer than 0 instead 0
Graeme Geldenhuys wrote:
Hi,
Attached is a application that demonstrates a bug in FormatFloat. All
tests pass when run under Delphi, but test four fails under Free
Pascal.
IMHO, fpc behaves correctly. 0.005 is closer than 0 instead 0.01. If you
try 0.0050001, you will have 0.01, also co
Hi,
Attached is a application that demonstrates a bug in FormatFloat. All
tests pass when run under Delphi, but test four fails under Free
Pascal.
Here is the application output:
---
$ ./project1
Time:00.001 N:7 E:0 F:1 I:0
TTestFormatFloat Time:00.001
18 matches
Mail list logo