Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Normalization of a number in Scratch
- Kami-ko
-
100+ posts
Normalization of a number in Scratch
QUICK TIP:
I don't know if anyone has mentioned this already, but there's a pretty simple way of getting the normalized value (scales value to -1, 0, or 1) of a number in Scratch. Simply use
and … that's it!
I don't know if anyone has mentioned this already, but there's a pretty simple way of getting the normalized value (scales value to -1, 0, or 1) of a number in Scratch. Simply use
and … that's it!
- Kami-ko
-
100+ posts
Normalization of a number in Scratch
It's not that advanced, but I wanted to let you guys know; hopefully this can help one of you
- Kami-ko
-
100+ posts
Normalization of a number in Scratch
0 would equal 0 Doesn't work if number = 0
- badatprogrammingibe
-
500+ posts
Normalization of a number in Scratch
That's an implementation of signum, not an implementation of normalisation. Even so, SimpleScratch is right in that it doesn't work with 0.
- Sheep_maker
-
1000+ posts
Normalization of a number in Scratch
should work with n = 0. It has a range of (-1, 1)
- XayCraft360
-
100+ posts
Normalization of a number in Scratch
if you think about it, it wouldn't work with numbers greater than 0. For example, 2 would give 2/3should work with n = 0. It has a range of (-1, 1)
- Kami-ko
-
100+ posts
Normalization of a number in Scratch
That's right haha, got my terms mixed up. That's an implementation of signum, not an implementation of normalisation. Even so, SimpleScratch is right in that it doesn't work with 0.
- --Explosion--
-
1000+ posts
Normalization of a number in Scratch
Frankly, this seems sorta obvious…
- 1132262
-
1000+ posts
Normalization of a number in Scratch
Easy.if you think about it, it wouldn't work with numbers greater than 0. For example, 2 would give 2/3should work with n = 0. It has a range of (-1, 1)
Last edited by 1132262 (March 4, 2020 23:57:44)
- 1132262
-
1000+ posts
Normalization of a number in Scratch
You underestimate the time we spend trying to get all of our code to fit into one expression. Frankly, this seems sorta obvious…
- --Explosion--
-
1000+ posts
Normalization of a number in Scratch
It should, 0/0 is 1. Doesn't work if number = 0
- 1132262
-
1000+ posts
Normalization of a number in Scratch
No…It should, 0/0 is 1. Doesn't work if number = 0
- Monna-Uka
-
1000+ posts
Normalization of a number in Scratch
x/0 in Scratch is equal to infinity. I know it because I have used this to pause the playing music.It should, 0/0 is 1. Doesn't work if number = 0
- NickyNouse
-
1000+ posts
Normalization of a number in Scratch
Yeah, Scratch (both 2 and 3) use a number standard called IEEE 754, which defines 1/0 as the special value Infinity and -1/0 as -Infinity.
- Maximouse
-
1000+ posts
Normalization of a number in Scratch
It should, 0/0 is 1. Doesn't work if number = 0
0/0 is undefined (NaN in Scratch). 1/0 is infinity.
- Discussion Forums
- » Advanced Topics
-
» Normalization of a number in Scratch