From 9cb3158dfd316b9b0f8fa2257eeb162c57bdabe5 Mon Sep 17 00:00:00 2001 From: Hans Svensson Date: Sun, 12 Sep 2021 16:24:08 +0200 Subject: [PATCH] Fix documentation and comments --- docs/sophia_stdlib.md | 2 +- priv/stdlib/Bitwise.aes | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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