in reply to Perl Hashes in C?

Welcome BrianP,

On a Linux 32 bit system, Perl still allows 2**53 integers if you compile Perl for 64 bit integers: (Note: If Perl is a 64 bit version, then the problem goes away!)

rperl -e 'use integer;$i=((2**17)**3);$m=2**53;print "$i\n$m\n";' 2251799813685248 9007199254740992
As you can see the maximum integer is larger than what you need. So you can generate integers directly by multiplying the 3 16 bit
<UPDATE>
To make sure nobody just multiplies the RGB together please remember that to represent the number 307 in decimal use:
perl -e '$n = (3*(10**2)) + (0*(10**1)) + (9*(10**0)); print "$n\n";'
So the formula is ($B is the base):
perl -e '$B = 10; $n = (3*($B**2)) + (0*($B**1)) + (9*($B**0)); print +"$n\n";'
So to generate 48 bit RGB integers you need:
perl -e '$B = 2**16; $n = ($R*($B**2)) + ($G*($B**1)) + ($B*($B**0)); +print "$n\n";'
Clarification complete!
</UPDATE>
values and then use that value as a hash key. Then each time you add a count just do:
$hash{$key}++; ## $key is 48 bit RGB as a single integer ## The value $hash{$key} is sum of the time +s found

Regards...Ed

"Well done is better than well said." - Benjamin Franklin