Discuss Scratch

anqelxx
Scratcher
100+ posts

What does "Abs of __" Do in Operators

Hii!
I was wondering what does that block do |
^
([ abs] of ())
In Operators ?

Last edited by anqelxx (Aug. 3, 2021 17:33:50)

A____username
Scratcher
100+ posts

What does "Abs of __" Do in Operators

It reports the absolute value of the input. The absolute value of a number is it's distance from 0. A simpler way to describe an absolute value is that it makes any number positive. If it is negative, it becomes positive, and if it is positive, it stays the same.
Lirey
Scratcher
100+ posts

What does "Abs of __" Do in Operators

Basically it makes any number you give it an even number. Here is an in depth explanation, abs stands for Absolute Value and the absolute value of something is the distance to 0. So the absolute value of -2 would be 2. The abs of 90 would be 90, so on so forth. I hope I answered your question!
1492864
Scratcher
500+ posts

What does "Abs of __" Do in Operators

It reports the distance the number is from 0.
Like:
([abs v] of (-10)) //Reports 10
([abs v] of (100)) //Reports 100
([abs v] of (0)) //Reports 0
Yusei-Fudo
Scratcher
1000+ posts

What does "Abs of __" Do in Operators

Lirey wrote:

Basically it makes any number you give it an even number.

Not true. It works with any number, even odds. It doesn't work to make an odd, even, it makes negative numbers positive.
Lirey
Scratcher
100+ posts

What does "Abs of __" Do in Operators

Yusei-Fudo wrote:

Lirey wrote:

Basically it makes any number you give it an even number.

Not true. It works with any number, even odds. It doesn't work to make an odd, even, it makes negative numbers positive.
Whoops my bad, that was a typo. I meant to say a positive number. Thanks for catching that
The_Imaginarium
Scratcher
1000+ posts

What does "Abs of __" Do in Operators

It is a number's magnitude.
anqelxx
Scratcher
100+ posts

What does "Abs of __" Do in Operators

Thankss!!
Yusei-Fudo
Scratcher
1000+ posts

What does "Abs of __" Do in Operators

Malak_koki wrote:

Thankss!!
yannick-lesseps
Scratcher
14 posts

What does "Abs of __" Do in Operators

thx
Raymond852
Scratcher
71 posts

What does "Abs of __" Do in Operators

It reports a number's distance from 0. Since distance can never be negative it reports any number as positive

1 = 1
-1 = 1
0 = 0

If you want to have an inverse
 ([abs v] of (9)) 
you can do

((0) - ([abs v] of ( )))

Powered by DjangoBB