WSJT-X/igray.f
Joe Taylor 2c17544f3f initial import
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/WSJT/trunk@1 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2005-12-22 16:40:53 +00:00

19 lines
422 B
Fortran

FUNCTION igray(n,is)
INTEGER igray,is,n
INTEGER idiv,ish
if (is.ge.0) then
igray=ieor(n,n/2)
else
ish=-1
igray=n
1 continue
idiv=ishft(igray,ish)
igray=ieor(igray,idiv)
if(idiv.le.1.or.ish.eq.-16)return
ish=ish+ish
goto 1
endif
return
END
C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12.