Files
2025-02-Numerical/lib/nr/cpp/recipes/irbit1.cpp
2025-09-12 18:55:25 +09:00

14 lines
227 B
C++

#include "nr.h"
int NR::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);
}