diff --git a/lib/pure/bitops.nim b/lib/pure/bitops.nim index ba4fc28bbb..3d2285cf9e 100644 --- a/lib/pure/bitops.nim +++ b/lib/pure/bitops.nim @@ -130,6 +130,9 @@ when defined(nimHasalignOf): macro setBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 1 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b0000_0011'u8 v.setBits(3, 5, 7) @@ -142,6 +145,9 @@ when defined(nimHasalignOf): macro clearBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 0 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b1111_1111'u8 v.clearBits(1, 3, 5, 7) @@ -154,6 +160,9 @@ when defined(nimHasalignOf): macro flipBits*(v: typed, bits: varargs[typed]): untyped = ## Returns ``v``, with the bits at positions ``bits`` set to 0 + ## + ## **Note:** + ## * ``v`` must be `var` variable. runnableExamples: var v = 0b0000_1111'u8 v.flipBits(1, 3, 5, 7)