Re: [AD] Timer patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Jan 30, 2008 8:51 AM, Elias Pschernig <elias@xxxxxxxxxx> wrote:

On Wed, 2008-01-30 at 04:50 -0800, Chris Robinson wrote:
> On Wednesday 30 January 2008 04:01:41 am AJ wrote:
> > what is the wrap time for  a double vs  int64_t ?
>
> A double won't wrap. It will continue increasing, eventually losing not only
> decimal precision, but also whole number precision, until hitting Inf.
>

And as I said some time ago, precision loss would be like this:

s: 2^53 years
ms: 200000 years
us: 200 years
ns: 90 days

--
Elias Pschernig <elias@xxxxxxxxxx>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers

If we used "long double" we would have 80-bit or 128-bit floats.  Double uses 64-bit of which 52-bits are fractional, 11 bit exponent, and 1 bit signed. So we'll have microsecond precision for about 200 years and then start seeing small errors for a few hundred more before things start to cause problems in the game. 64-bit ought to be enough for anybody!


-- Ryan Dickie


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/