Arithmetic/Integer: Difference between revisions

m
Moved category "Arithmetic" to top of page
m (Restored alphabetical order of languages)
m (Moved category "Arithmetic" to top of page)
Line 1:
{{Task|Basic language learning}}
{{Task|Basic language learning}}[[Category:Arithmetic operations]]{{basic data operation}}Get two integers from the user, and then output the sum, difference, product, integer quotient and remainder of those numbers. Don't include error handling. For quotient, indicate how it rounds (e.g. towards 0, towards negative infinity, etc.). For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.
[[Category:Arithmetic operations]]
[[Category:Arithmetic]]
{{basic data operation}}
{{Task|Basic language learning}}[[Category:Arithmetic operations]]{{basic data operation}}Get two integers from the user, and then output the sum, difference, product, integer quotient and remainder of those numbers. Don't include error handling. For quotient, indicate how it rounds (e.g. towards 0, towards negative infinity, etc.). For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.
 
Also include the exponentiation operator if one exists.
Line 2,930 ⟶ 2,934:
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>
 
 
[[Category:Arithmetic]]