Arithmetic/Integer: Difference between revisions

Added Maple implementation
(Added Maple implementation)
Line 1,099:
define(`B', 6)dnl
include(`operations.m4')</lang>
 
=={{header|Maple}}==
These operations are all built-in. As all operations are exact, there are no rounding issues involved.
<lang Maple>
DoIt := proc()
local a := readstat( "Input an integer: " ):
local b := readstat( "Input another integer: " ):
printf( "Sum = %d\n", a + b ):
printf( "Difference = %d\n", a - b ):
printf( "Product = %d\n", a * b ):
printf( "Quotient = %d\n", iquo( a, b, 'c' ) ):
printf( "Remainder = %d\n", c ); # or irem( a, b )
NULL # quiet return
end proc:
</lang>
Here is an example of calling DoIt.
<lang Maple>
> DoIt();
Input an integer: 15;
Input another integer: 12;
Sum = 27
Difference = 3
Product = 180
Quotient = 1
Remainder = 3
>
</lang>
 
=={{header|Mathematica}}==
Anonymous user