# HG changeset patch # User al # Date 1139572778 0 # Node ID 9cbd63cca8263e62f6083c30b763eaead3fb2a63 # Parent 2d35fb3cb94018bf98ed3c36a165ebe205ff0e12 Don't use pow/powf functions where we just need integer arithmetic. approved by Benjamin diff -r 2d35fb3cb940 -r 9cbd63cca826 cook.c --- a/cook.c Fri Feb 10 06:55:25 2006 +0000 +++ b/cook.c Fri Feb 10 11:59:38 2006 +0000 @@ -185,8 +185,8 @@ int i; q->pow2tab[63] = 1.0; for (i=1 ; i<64 ; i++){ - q->pow2tab[63+i]=(float)pow(2.0,(double)i); - q->pow2tab[63-i]=1.0/(float)pow(2.0,(double)i); + q->pow2tab[63+i]=(float)((uint64_t)1<pow2tab[63-i]=1.0/(float)((uint64_t)1<rootpow2tab[63] = 1.0; for (i=1 ; i<64 ; i++){ - q->rootpow2tab[63+i]=sqrt((float)powf(2.0,(float)i)); - q->rootpow2tab[63-i]=sqrt(1.0/(float)powf(2.0,(float)i)); + q->rootpow2tab[63+i]=sqrt((float)((uint64_t)1<rootpow2tab[63-i]=sqrt(1.0/(float)((uint64_t)1<