Page 2 of 2

PostPosted: Mon Apr 24, 2006 4:23 am
by bob
Code: Select all


int thething(int n)
{
return nthbit(n,0) ^ nthbit(n,2) ^ nthbit(n,17);
}


PostPosted: Mon Apr 24, 2006 4:26 am
by bob
Shorter version for this particular case:
Code: Select all
int thething(int n)
{
  return (n ^ (n>>2) ^ (n>>17))&1;
}

PostPosted: Tue Feb 13, 2007 5:07 am
by Jonathan
Somewhat on topic, Perl 5.8 is not 64-bit safe! You think you're all fine with a 64 bit number encoded as a string, then you try to do math on it and you're screwed. A friend of mine threw together a 64 bit math library using bit arrays, but it is painfully slow when trying to do real work.

Math::BigInt is a step in the right direction, but I think it's useless when you're trying to do math on hex input to produce hex output.

PostPosted: Tue Feb 13, 2007 7:29 pm
by quantus
Is there documentation of this somewhere?

PostPosted: Wed Feb 14, 2007 8:58 pm
by Dave
I just get annoyed that apparently these 64 bit machines can't connect to some printers/plotters.