シフトがだめならローテートすればいいのよ y%=((x%<<1)+((x%>>15) and 1)) and &hffff x%=((y%>>1)+((y% and 1)<<15)) and &hffff