[an error occurred while processing this directive]
|
int remainder5(unsigned short d)
{
static int const remainders[16]={0x8000%5,0x4000%5,0x2000%5,
0x1000%5,0x800%5,0x400%5,0x200%5,0x100%5,0x80%5,
0x40%5,0x20%5,0x10%5,0x8%5,0x4%5,0x2%5,0x1%5};
int i, r = 0;
for (i=0; i<15; i++)
{
if ( d & (0x8000 >> i) )
{
r += remainders[i];
if ( r >= 5 ) r -= 5;
}
}
return r;
}
E-mail: info@telesys.ru