πŸ“˜ Prefix operator +^ in Perl 6

πŸ“˜ Prefix operator +^ in Raku

N. B. Perl 6 has been renamed to Raku. Click to read more.


+^ is a bitwise negation operator with two’s complement.

my $x = 10;
my $y = +^$x;
say $y; # -11 (but not -10)

Compare this operator with the following one.

Leave a Reply

Your email address will not be published. Required fields are marked *

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code