POV-Ray : Newsgroups : povray.general : Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys? : Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys? Server Time
1 Aug 2024 04:13:25 EDT (-0400)
  Re: Real benefit of a 64 bit Pov binary on a 64 bit CPU in a 64 bit opsys?  
From: Nicolas George
Date: 27 Aug 2006 19:00:03
Message: <44f223f3@news.povray.org>
Warp  wrote in message <44f1fe00@news.povray.org>:
> Nicolas George <nicolas$george@salle-s.org> wrote:
>>     for(i = 0; i <= N; i++)
>>         r += (double)i * (i / 100000000);
> 
>   What is the type of 'i' there?

An unsigned; but it should not change anything, since it is the very same
code in both modes. Well, it could have been a long long, but I am not that
careless; and in fact, the difference between 64-bit integer arithmetic in
both modes is much smaller. Some of the missing parts are:

#define N 1000000000

static double
calc_double(void)
{
    unsigned i;
    register double r = 0; /* or not register */

    for(i = 0; i <= N; i++)
        r += (double)i * (i / 100000000);
    return(r);
}

    getrusage(RUSAGE_SELF, &t0);
    r1 = calc_double();
    getrusage(RUSAGE_SELF, &t1);

(the rest is just necessary noise)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.