From 2de11930da9d017d462f7bf5d179c82331b51427 Mon Sep 17 00:00:00 2001 From: JJ Merelo Date: Wed, 25 Jul 2018 18:30:53 +0200 Subject: [PATCH] Adds documentation for Unicode superscript ops closes #1098 --- doc/Language/operators.pod6 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/Language/operators.pod6 b/doc/Language/operators.pod6 index e9a77afa8..efe9aa307 100644 --- a/doc/Language/operators.pod6 +++ b/doc/Language/operators.pod6 @@ -877,6 +877,17 @@ If the right-hand side is a non-negative integer and the left-hand side is an arbitrary precision type (L, L), then the calculation is carried out without loss of precision. +Unicode superscripts will behave in exactly the same way. + + sub squared( Int $num ) { $num² }; + say squared($_) for ^5; OUTPUT: «0␤1␤4␤9␤16␤» + +It also works for sequences of several Unicode superscript numbers + + sub twentytwoed( Int $num ) { $num²² }; + say twentytwoed($_) for ^5; # OUTPUT: «0␤1␤4194304␤31381059609␤17592186044416␤» + + =head1 Symbolic unary precedence =head2 prefix C«?»