add docs and tests
This commit is contained in:
parent
6cc28c0589
commit
88c1ea30e4
3 changed files with 35 additions and 1 deletions
|
@ -92,6 +92,36 @@ available as <function>builtins.derivation</function>.</para>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry><term><function>builtins.bitAnd</function>
|
||||||
|
<replaceable>e1</replaceable> <replaceable>e2</replaceable></term>
|
||||||
|
|
||||||
|
<listitem><para>Return the bitwise AND of the integers
|
||||||
|
<replaceable>e1</replaceable> and
|
||||||
|
<replaceable>e2</replaceable>.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry><term><function>builtins.bitOr</function>
|
||||||
|
<replaceable>e1</replaceable> <replaceable>e2</replaceable></term>
|
||||||
|
|
||||||
|
<listitem><para>Return the bitwise OR of the integers
|
||||||
|
<replaceable>e1</replaceable> and
|
||||||
|
<replaceable>e2</replaceable>.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
|
<varlistentry><term><function>builtins.bitXor</function>
|
||||||
|
<replaceable>e1</replaceable> <replaceable>e2</replaceable></term>
|
||||||
|
|
||||||
|
<listitem><para>Return the bitwise XOR of the integers
|
||||||
|
<replaceable>e1</replaceable> and
|
||||||
|
<replaceable>e2</replaceable>.</para></listitem>
|
||||||
|
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
|
||||||
<varlistentry><term><varname>builtins</varname></term>
|
<varlistentry><term><varname>builtins</varname></term>
|
||||||
|
|
||||||
<listitem><para>The set <varname>builtins</varname> contains all
|
<listitem><para>The set <varname>builtins</varname> contains all
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2188
|
2216
|
||||||
|
|
|
@ -26,6 +26,10 @@ let {
|
||||||
(56088 / 123 / 2)
|
(56088 / 123 / 2)
|
||||||
(3 + 4 * const 5 0 - 6 / id 2)
|
(3 + 4 * const 5 0 - 6 / id 2)
|
||||||
|
|
||||||
|
(builtins.bitAnd 12 10) # 0b1100 & 0b1010 = 8
|
||||||
|
(builtins.bitOr 12 10) # 0b1100 | 0b1010 = 14
|
||||||
|
(builtins.bitXor 12 10) # 0b1100 ^ 0b1010 = 6
|
||||||
|
|
||||||
(if 3 < 7 then 1 else err)
|
(if 3 < 7 then 1 else err)
|
||||||
(if 7 < 3 then err else 1)
|
(if 7 < 3 then err else 1)
|
||||||
(if 3 < 3 then err else 1)
|
(if 3 < 3 then err else 1)
|
||||||
|
|
Loading…
Reference in a new issue