Bee Jay bee.ogra...@gmail.com:
[TDateTime]
What if an app need a precise and correct result, say a rocket launcher?
:D Is there other alternative solution?
Yes. Use a time type based on a fixed point representation. This eliminates
drift and accuracy issues cause by a floating point
On 30 Mei 2010, at 19:47, Jonas Maebe wrote:
They should not be using any FPC functionality relying on floating point. Any
person who uses floating point should know that by definition it is inexact
(ranging from a little to enormously, depending on what you do).
I understand.
That last
But if I changed the milisecond part of a or b or both to anything but 0 then
the result is correct.
Correction... the bug arises NOT only if the msec part is 0. The bug arises if
msec part of both variables are EQUAL. If they are different, at least 1 msec,
then those functions produce
Hi all,
Try the following code snippet:
uses
DateUtils;
var
a,b: TDateTime;
i: integer;
begin
a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0);
for i := 0 to 9 do
begin
b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0);
Writeln(SecondsBetween(a,b):3);
end;
end;
I think the result
In our previous episode, Bee Jay said:
Hi all,
Try the following code snippet:
uses
DateUtils;
var
a,b: TDateTime;
i: integer;
begin
a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0);
for i := 0 to 9 do
begin
b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0);
On 30 Mei 2010, at 19:18, Marco van de Voort wrote:
IIRC this is normal and delphi compatible and due to TDatetime being a
floating point type.
No, it's not Delphi compatible. Delphi's result is alot worst, at least on
Delphi 7. And I didn't ask to make it truly compatible with Delphi. ;)
On 30 May 2010, at 14:23, Bee Jay wrote:
What if an app need a precise and correct result, say a rocket launcher?
Then it shouldn't use floating point. Ever.
Jonas
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
On 30 Mei 2010, at 19:28, Jonas Maebe wrote:
Then it shouldn't use floating point. Ever.
Well... then it shouldn't be using FPC? ;)
Ok, forget about the rocket launcher. The important note that I think need to
be addressed is the bug only occurs if the milisecond part of a or b is 0.
Other
On 30 May 2010, at 14:38, Bee Jay wrote:
2010, at 19:28, Jonas Maebe wrote:
Then it shouldn't use floating point. Ever.
Well... then it shouldn't be using FPC? ;)
They should not be using any FPC functionality relying on floating point. Any
person who uses floating point should know
In our previous episode, Bee Jay said:
Then it shouldn't use floating point. Ever.
Well... then it shouldn't be using FPC? ;)
This kind of problems are universal, and TDateTime is a library invention.
If you have an integer date based library, you can use that instead.
Ok, forget about the
10 matches
Mail list logo