@@ -292,22 +292,26 @@ an infinity then Decimal('Infinity') is returned.\n\
292292
293293PyDoc_STRVAR (doc_logical_and,
294294" logical_and($self, /, other, context=None)\n --\n\n \
295- Return the digit-wise 'and' of the two (logical) operands.\n \
295+ Applies an 'and' operation between self and other's digits.\n\n \
296+ Both self and other must be logical numbers.\n \
296297\n " );
297298
298299PyDoc_STRVAR (doc_logical_invert,
299300" logical_invert($self, /, context=None)\n --\n\n \
300- Return the digit-wise inversion of the (logical) operand.\n \
301+ Invert all its digits.\n\n \
302+ The self must be logical number.\n \
301303\n " );
302304
303305PyDoc_STRVAR (doc_logical_or,
304306" logical_or($self, /, other, context=None)\n --\n\n \
305- Return the digit-wise 'or' of the two (logical) operands.\n \
307+ Applies an 'or' operation between self and other's digits.\n\n \
308+ Both self and other must be logical numbers. \n \
306309\n " );
307310
308311PyDoc_STRVAR (doc_logical_xor,
309312" logical_xor($self, /, other, context=None)\n --\n\n \
310- Return the digit-wise 'exclusive or' of the two (logical) operands.\n \
313+ Applies an 'xor' operation between self and other's digits.\n\n \
314+ Both self and other must be logical numbers.\n \
311315\n " );
312316
313317PyDoc_STRVAR (doc_max,
@@ -712,22 +716,90 @@ Return the exponent of the magnitude of the operand's MSD.\n\
712716
713717PyDoc_STRVAR (doc_ctx_logical_and,
714718" logical_and($self, x, y, /)\n --\n\n \
715- Digit-wise and of x and y.\n \
719+ Applies the logical operation 'and' between each operand's digits.\n\n \
720+ The operands must be both logical numbers.\n\n \
721+ >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))\n \
722+ Decimal('0')\n \
723+ >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))\n \
724+ Decimal('0')\n \
725+ >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))\n \
726+ Decimal('0')\n \
727+ >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))\n \
728+ Decimal('1')\n \
729+ >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))\n \
730+ Decimal('1000')\n \
731+ >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))\n \
732+ Decimal('10')\n \
733+ >>> ExtendedContext.logical_and(110, 1101)\n \
734+ Decimal('100')\n \
735+ >>> ExtendedContext.logical_and(Decimal(110), 1101)\n \
736+ Decimal('100')\n \
737+ >>> ExtendedContext.logical_and(110, Decimal(1101))\n \
738+ Decimal('100')\n \
716739\n " );
717740
718741PyDoc_STRVAR (doc_ctx_logical_invert,
719742" logical_invert($self, x, /)\n --\n\n \
720- Invert all digits of x.\n \
743+ Invert all the digits in the operand.\n\n \
744+ The operand must be a logical number.\n\n \
745+ >>> ExtendedContext.logical_invert(Decimal('0'))\n \
746+ Decimal('111111111')\n \
747+ >>> ExtendedContext.logical_invert(Decimal('1'))\n \
748+ Decimal('111111110')\n \
749+ >>> ExtendedContext.logical_invert(Decimal('111111111'))\n \
750+ Decimal('0')\n \
751+ >>> ExtendedContext.logical_invert(Decimal('101010101'))\n \
752+ Decimal('10101010')\n \
753+ >>> ExtendedContext.logical_invert(1101)\n \
754+ Decimal('111110010')\n \
721755\n " );
722756
723757PyDoc_STRVAR (doc_ctx_logical_or,
724758" logical_or($self, x, y, /)\n --\n\n \
725- Digit-wise or of x and y.\n \
759+ Applies the logical operation 'or' between each operand's digits.\n\n \
760+ The operands must be both logical numbers.\n\n \
761+ >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))\n \
762+ Decimal('0')\n \
763+ >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))\n \
764+ Decimal('1')\n \
765+ >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))\n \
766+ Decimal('1')\n \
767+ >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))\n \
768+ Decimal('1')\n \
769+ >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))\n \
770+ Decimal('1110')\n \
771+ >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))\n \
772+ Decimal('1110')\n \
773+ >>> ExtendedContext.logical_or(110, 1101)\n \
774+ Decimal('1111')\n \
775+ >>> ExtendedContext.logical_or(Decimal(110), 1101)\n \
776+ Decimal('1111')\n \
777+ >>> ExtendedContext.logical_or(110, Decimal(1101))\n \
778+ Decimal('1111')\n \
726779\n " );
727780
728781PyDoc_STRVAR (doc_ctx_logical_xor,
729782" logical_xor($self, x, y, /)\n --\n\n \
730- Digit-wise xor of x and y.\n \
783+ Applies the logical operation 'xor' between each operand's digits.\n\n \
784+ The operands must be both logical numbers.\n\n \
785+ >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))\n \
786+ Decimal('0')\n \
787+ >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))\n \
788+ Decimal('1')\n \
789+ >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))\n \
790+ Decimal('1')\n \
791+ >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))\n \
792+ Decimal('0')\n \
793+ >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))\n \
794+ Decimal('110')\n \
795+ >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))\n \
796+ Decimal('1101')\n \
797+ >>> ExtendedContext.logical_xor(110, 1101)\n \
798+ Decimal('1011')\n \
799+ >>> ExtendedContext.logical_xor(Decimal(110), 1101)\n \
800+ Decimal('1011')\n \
801+ >>> ExtendedContext.logical_xor(110, Decimal(1101))\n \
802+ Decimal('1011')\n \
731803\n " );
732804
733805PyDoc_STRVAR (doc_ctx_max,
0 commit comments