Jump to content

Arithmetic/Integer: Difference between revisions

m
→‎{{header|Raku}}: update obsoleted explainer
m (→‎{{header|Raku}}: update obsoleted explainer)
Line 4,418:
=={{header|Raku}}==
(formerly Perl 6)
 
{{works with|Rakudo|2015.09}}
operand types". [http://perlcabal.org/syn/S03.html#line_729 Synopsis 3] guaranteesNote that <code>div</code> "on built-in<b>requires</b> integer types is equivalent to taking the floor of a real division"arguments. If you want integer division with other types, say <code>floor($a/$b)</code>.
<lang perl6>my Int $a = get.floor;
my Int $b = get.floor;
Line 4,428 ⟶ 4,429:
say 'remainder: ', $a % $b;
say 'exponentiation: ', $a**$b;</lang>
 
Note that <code>div</code> doesn't always do integer division; it performs the operation "most appropriate to the
operand types". [http://perlcabal.org/syn/S03.html#line_729 Synopsis 3] guarantees that <code>div</code> "on built-in integer types is equivalent to taking the floor of a real division". If you want integer division with other types, say <code>floor($a/$b)</code>.
 
=={{header|Raven}}==
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.