File tree Expand file tree Collapse file tree
exercises/practice/rational-numbers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,15 +144,13 @@ example: |-
144144 }
145145
146146stub : |-
147- class RationalNumbers {
148147 has Int $.a;
149148 has Int $.b;
150149
151- method add (RationalNumbers $op) { }
152- method subtract (RationalNumbers $op) { }
153- method multiply (RationalNumbers $op) { }
154- method divide (RationalNumbers $op) { }
155- method absolute { }
156- method exponent ($power) { }
157- method base ($base) { }
158- }
150+ method add (RationalNumbers $op) { self }
151+ method subtract (RationalNumbers $op) { self }
152+ method multiply (RationalNumbers $op) { self }
153+ method divide (RationalNumbers $op) { self }
154+ method absolute { self }
155+ method exponent ($power) { self }
156+ method base ($base) { self }
Original file line number Diff line number Diff line change 11unit class RationalNumbers ;
22
3- class RationalNumbers {
4- has Int $ . a ;
5- has Int $ . b ;
3+ has Int $ . a ;
4+ has Int $ . b ;
65
7- method add (RationalNumbers $ op ) { }
8- method subtract (RationalNumbers $ op ) { }
9- method multiply (RationalNumbers $ op ) { }
10- method divide (RationalNumbers $ op ) { }
11- method absolute { }
12- method exponent ($ power ) { }
13- method base ($ base ) { }
14- }
6+ method add (RationalNumbers $ op ) { self }
7+ method subtract (RationalNumbers $ op ) { self }
8+ method multiply (RationalNumbers $ op ) { self }
9+ method divide (RationalNumbers $ op ) { self }
10+ method absolute { self }
11+ method exponent ($ power ) { self }
12+ method base ($ base ) { self }
You can’t perform that action at this time.
0 commit comments