This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-09 00:30:25

Mitchell445
New Scratcher
Registered: 2012-05-08
Posts: 2

abs

what is abs?

Offline

 

#2 2012-05-09 00:32:39

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: abs

Do you mean ABS? That stands for Anti-lock Brakes, but I'm pretty sure that's not what you mean. Let me check if there's a trig function in Scratch or something called abs  tongue

Ah, there is. Check out this Wiki article.  smile

http://wiki.scratch.mit.edu/wiki/()_of_ … ock)#abs_2


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2012-05-19 18:19:57

chinydo
Scratcher
Registered: 2010-08-16
Posts: 69

Re: abs

absolute value

Offline

 

#4 2012-05-19 18:28:15

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: abs

As noted above, it stands for "absolute value".  It is basically the distance a number is from zero.  Another way to think of it is that the absolute value of a number is the positive value of that number.

abs of -4 = 4
abs of 4 = 4
abs of 0 = 0
abs of 0.35 = 0.35
abs of -0.35 = 0.35

Edit: oops, just realized how similar to wiki that post sounds xD

Last edited by MoreGamesNow (2012-05-19 18:28:56)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-05-20 16:29:59

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: abs

Basically, using

[abs v] of (number)
is a more effective way of writing
if <(number) < [0]>
set [number v] to ((number)*[-1])


http://i46.tinypic.com/ao03lk.png

Offline

 

Board footer