Skip to content

Commit 7313da6

Browse files
authored
Merge pull request #2849 from lukasvalle/master
Exception for infix:<x> and infix:<xx> with -Inf and NaN
2 parents e9e1412 + 5b14a35 commit 7313da6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/Language/operators.pod6

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,8 @@ operation.
12581258
X<String repetition operator>.
12591259
12601260
Repeats the string C<$a> C<$b> times, if necessary coercing C<$a> to L«C<Str>|/type/Str»
1261-
and C<$b> L«C<Int>|/type/Int». Returns an empty string if C<< $b <= 0 >>.
1261+
and C<$b> L«C<Int>|/type/Int». Returns an empty string if C<< $b <= 0 >>. An exception
1262+
C<X::Numeric::CannotConvert> will be thrown if C<$b> is C<-Inf> or C<NaN>.
12621263
12631264
say 'ab' x 3; # OUTPUT: «ababab␤»
12641265
say 42 x 3; # OUTPUT: «424242␤»
@@ -1286,7 +1287,8 @@ Defined as:
12861287
In general, it returns a Sequence of C<$a> repeated and evaluated C<$b> times
12871288
(C<$b> is coerced to L<Int|/type/Int>). If C<< $b <= 0 >>, the empty list is
12881289
returned. It will return an error with no operand, and return the operand itself
1289-
with a single operand.
1290+
with a single operand. An exception C<X::Numeric::CannotConvert> will be
1291+
thrown if C<$b> is C<-Inf> or C<NaN>.
12901292
12911293
The left-hand side is evaluated for each repetition, so
12921294

0 commit comments

Comments
 (0)