Discuss Scratch

WallydogChoppychop
Scratcher
500+ posts

What do the blocks abs, mod and round mean?

Here are the blocks
((round ([ v] of (9))) mod (0))
fdreerf
Scratcher
1000+ posts

What do the blocks abs, mod and round mean?

The round block round a number to the nearest whole number, or integer.
(round (1.4))
returns 1 as that is the closest whole number to 1.4.

Mod, short for modulo, is the remainder when dividing two numbers together. If you do standard long division, 12 divided by 5 equals 2, remainder 2. The mod block only reports the remainder part.

Abs, short for absolute value, returns the distance from zero. It makes negative numbers, like -43
([abs v] of (-43))
positive, in this case, 43. It does nothing to positive numbers.
WallydogChoppychop
Scratcher
500+ posts

What do the blocks abs, mod and round mean?

What about all the things in abs block [( The differt ptions)
gilbert_given_189
Scratcher
1000+ posts

What do the blocks abs, mod and round mean?

([sin v] of ()) // returns sin(x degrees) (sine function)
([cos v] of ()) // returns cos(x degrees) (cosine function)
([tan v] of ()) // returns tan(x degrees) (tangent function)
([asin v] of ()) // returns sin^-1(x degrees)(inverse sine function)
([acos v] of ()) // returns cos^-1(x degrees) (inverse cosine function)
([atan v] of ()) // returns tan^-1(x degrees) (inverse tangent function)
([floor v] of ()) // always round down (for example: 13.8 => 13)
([ceiling v] of ()) // always round up (for example: 13.1 => 14)
([sqrt v] of ()) // returns the square root of number (for example: 4 => 2, 9 => 3)
([ln v] of ()) // returns the natural log of number (for example: e => 1)
([log v] of ()) // returns the logarithm of number (for example: 1 => 0, 10 => 1, 100 => 2)
([e ^ v] of ()) // returns e to the power of number (for example: 1 => e)
([10 ^ v] of ()) // returns 10 to the power of number (for example: 0 => 1, 1 => 10, 2 => 100)
fdreerf
Scratcher
1000+ posts

What do the blocks abs, mod and round mean?

I already went over abs.
Floor rounds down to the nearest integer. Normally, rounding 3.8 gives 4, but floor 3.8 is 3.
Ceiling rounds up to the nearest integer. Normally, rounding 3.2 gives 3, but ceiling 3.2 is 4.

To square a number is to multiply it with itself. The square of 5 is 5*5, or 25. The square root is the number you'd have to square in order to get that number. The square root of 16 is 4, since 4*4 = 16.

Sine, cosine, tangent, and their arc counterparts are trigonometric functions. They're pretty complex but one day you'll be forced to learn them in school.

Exponents repeatedly multiply a number by itself. 2^5 is 2*2*2*2*2, or 32. 10^ does that with the number 10, so 10^3 is 10*10*10, or 1000. e^ is similar but uses the irrational constant approximately equal to 2.71828.

Log and linear, or ln, are the reverse of these operations. 10^2 gives 100, but log 100 gives 2.
WallydogChoppychop
Scratcher
500+ posts

What do the blocks abs, mod and round mean?

Thanks

Powered by DjangoBB