add numerical recipes library
This commit is contained in:
12
lib/nr/ansi/recipes/irbit1.c
Normal file
12
lib/nr/ansi/recipes/irbit1.c
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
int irbit1(unsigned long *iseed)
|
||||
{
|
||||
unsigned long newbit;
|
||||
|
||||
newbit = (*iseed >> 17) & 1
|
||||
^ (*iseed >> 4) & 1
|
||||
^ (*iseed >> 1) & 1
|
||||
^ (*iseed & 1);
|
||||
*iseed=(*iseed << 1) | newbit;
|
||||
return (int) newbit;
|
||||
}
|
||||
Reference in New Issue
Block a user