diff --git a/docs/sophia_stdlib.md b/docs/sophia_stdlib.md index 7920a6c..776ee0f 100644 --- a/docs/sophia_stdlib.md +++ b/docs/sophia_stdlib.md @@ -1820,7 +1820,7 @@ Cyclic rotation of the elements to the left. ### Bitwise -Bitwise operations on arbitary precision integers. +Bitwise operations on arbitrary precision integers. #### bsr ``` diff --git a/priv/stdlib/Bitwise.aes b/priv/stdlib/Bitwise.aes index 8538074..63be770 100644 --- a/priv/stdlib/Bitwise.aes +++ b/priv/stdlib/Bitwise.aes @@ -63,7 +63,7 @@ namespace Bitwise = // bitwise 'not' for arbitrary precision integers function bnot(a : int) = bxor(a, -1) - // Bitwise 'and' for positive integers + // Bitwise 'and' for non-negative integers function uband(a : int, b : int) : int = require(a >= 0 && b >= 0, "uband is only defined for non-negative integers") switch((a, b)) @@ -81,7 +81,7 @@ namespace Bitwise = 2 => uband__(a / 2, b / 2, val * 2, acc + val) _ => uband__(a / 2, b / 2, val * 2, acc) - // Bitwise or for positive integers + // Bitwise 'or' for non-negative integers function ubor(a, b) = require(a >= 0 && b >= 0, "ubor is only defined for non-negative integers") switch((a, b)) @@ -98,7 +98,7 @@ namespace Bitwise = 0 => ubor__(a / 2, b / 2, val * 2, acc) _ => ubor__(a / 2, b / 2, val * 2, acc + val) - //Bitwise xor for positive integers + //Bitwise 'xor' for non-negative integers function ubxor : (int, int) => int ubxor(0, b) = b