⭐ 1.5.7 Understanding Other Operations

View

Scratch can go far beyond basic math and logic. The last three blocks in the Operators Block Palette perform math functions that are not basic operations but are quite common in Scratch programs.

() mod ()

The () mod () block divides the first number by the second number and then tells you what is left over (the remainder). For example, if you make a (7) mod (3) block, the result will be 1, because 7 can be divided by 3 twice, with 1 left over. Figure 37 shows the () mod () block in action.

M2

Figure 37: Using the () mod () block

Round ()

The round () block rounds a number to its closest whole number. For example, the block in Figure 38 produces a value of 8 because 7.51 is closer to 8 than it is to 7.

M3

Explaining how all these functions work and when you might use them is more than we have space for in this guide. If you are curious about them, you can read about them on the Scratch website
at http://wiki.Scratch.mit.edu/wiki/()_of_(). Some of them are used in advanced mathematics, and they can help you create more natural movements, curves and lines on the Stage and solve complex problems.


Last modified: Thursday, 23 September 2021, 12:38 PM