Jump to content

Arithmetic/Integer: Difference between revisions

→‎{{header|Logo}}: actually test it
(→‎{{header|Logo}}: actually test it)
Line 180:
=={{header|Logo}}==
to operate :a :b
show(print [a = ] print :a)
show(print [b = ] print :b)
show(print [a + b = ] print :a + :b)
show(print [a - b = ] print :a - :b)
show(print [a * b = ] print :a * :b)
show(print [a / b = ] print int (:a / :b)
show(print [a mod b = ] print modulo :a :b)
end
 
Each infix operator also has a prefix synonym (sum, difference, product, quotient). Sum and product can also have arity greater than two when used in parentheses (sum 1 2 3). Infix operators in general have high precedence; you may need to enclose their arguments in parentheses to obtain the correct expression.
 
=={{header|LSE64}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.