Skip to content

Commit a075be8

Browse files
committed
[Numeric] explain "widest type" rule
1 parent d2acc93 commit a075be8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/Numeric.pod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
77
Common role for numbers and types that can act as numbers.
88
9+
Binary numeric operations return an object of the "wider" type:
10+
11+
Int narrowest
12+
Rat
13+
FatRat
14+
Num
15+
Complex widest
16+
17+
So for example the product of a L<Rat> and an L<Int> return a L<Rat>.
18+
19+
Unary operations that in pure math usually return an irrational number
20+
generally return L<Num> in Perl 6.
21+
922
=head1 Methods
1023
1124
=head2 Real

0 commit comments

Comments
 (0)