Arithmetic/Integer: Difference between revisions

Content added Content deleted
mNo edit summary
No edit summary
Line 3,582: Line 3,582:
println("x%y = ",x % y); // remainder; matches sign of first operand when operands' signs differ
println("x%y = ",x % y); // remainder; matches sign of first operand when operands' signs differ
println("x.divr(y) = ",x.divr(y)); // (x/y,remainder); sign as above</lang>
println("x.divr(y) = ",x.divr(y)); // (x/y,remainder); sign as above</lang>

=={{header|ZX Spectrum Basic}}==
<lang zxbasic>5 LET a=5: LET b=3
10 PRINT a;" + ";b;" = ";a+b
20 PRINT a;" - ";b;" = ";a-b
30 PRINT a;" * ";b;" = ";a*b
40 PRINT a;" / ";b;" = ";INT (a/b)
50 PRINT a;" mod ";b;" = ";a-INT (a/b)*b
60 PRINT a;" to the power of ";b;" = ";a^b
</lang>