snap can do calculations for you. Operations such as
and
report the result of their calculations, so they are called "reporter" blocks. You can nest them inside each other:
= (5 + 4) · 3 = 9 · 3 = 27
round 3.14
and round 401.9
. (number) mod (2)
report 0 and when does it report 1?
(23) mod (2)
will report.The block reports the remainder when the first input is divided by the second. For example,
because when 17 is divided by 5, the remainder is 2.
When one number divides another evenly, the remainder is 0: . The Boolean expression
reports
if n is divisible by 2 (meaning
n
is even) and if
n
is odd (not divisible by 2 and so the remainder is not 0).