User Tools

Site Tools


prime:bitwise

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
prime:bitwise [2017/12/04 03:13]
webmasterpdx
prime:bitwise [2017/12/04 23:16] (current)
webmasterpdx
Line 8: Line 8:
 EXPORT BITLIB() EXPORT BITLIB()
 BEGIN BEGIN
- 
 END; END;
  
Line 18: Line 17:
 EXPORT BITSRC(X,N) // BITSR WITH CARRY EXPORT BITSRC(X,N) // BITSR WITH CARRY
 BEGIN // SET C + RETURN SHIFTED BEGIN // SET C + RETURN SHIFTED
- LOCAL r; 
  ​C:​=BITSR(X,​N-1);​  ​C:​=BITSR(X,​N-1);​
- r:=BITSR(X,N)+ RETURN ​BITSR(X,N);
- ​RETURN r;+
 END; END;
  
 EXPORT BITSLC(X,N) // BITSL WITH CARRY EXPORT BITSLC(X,N) // BITSL WITH CARRY
 BEGIN // SET C + RETURN SHIFTED BEGIN // SET C + RETURN SHIFTED
- LOCAL r; 
  ​C:​=BITSR(BITSL(X,​N-1),​GETBITS(X)-1);​  ​C:​=BITSR(BITSL(X,​N-1),​GETBITS(X)-1);​
- r:=BITSL(X,N)+ RETURN ​BITSL(X,​N); ​
- ​RETURN r+
 END; END;
  
prime/bitwise.txt · Last modified: 2017/12/04 23:16 by webmasterpdx