Discuss Scratch
- Think_Quest
-
14 posts
Powers
Hey guys. I was thinking we could have a power operator that looks something like this:
Or
It can also look like this:
((4) ** (5))For example:
((3) ** (4))Would evaluate to 81 (3x3x3x3).
Or
((7) ** (2))Would evaluate to 49 (7x7).
It can also look like this:
((5) ^ (3))
- stickfiregames
-
1000+ posts
Powers
Support, although it has been suggested before.
I think it should look like
I think it should look like
(() ^ () :: operators)it is probably more recognised than **
Last edited by stickfiregames (Nov. 11, 2014 08:05:15)
- 20btheilmanngohr
-
100+ posts
Powers
(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
- ShamelessSnores
-
100+ posts
Powers
Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
- TheHockeyist
-
1000+ posts
Powers
Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
Last edited by TheHockeyist (Nov. 11, 2014 16:05:14)
- OmnipotentPotato
-
1000+ posts
Powers
Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
- Sonickyle
-
1000+ posts
Powers
Support. Why doesn't this exist yet?Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
- 20btheilmanngohr
-
100+ posts
Powers
I think there is a workaround
Still support
define (Num1) ^ (Num2)Please, correct me if I am wrong.
repeat (Num2)
set [output v] to ((output) * (Num1))
end
Still support
Last edited by 20btheilmanngohr (Nov. 11, 2014 18:04:20)
- KingOfAwesome58219
-
1000+ posts
Powers
SupportSupport. Why doesn't this exist yet?Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
- stickfiregames
-
1000+ posts
Powers
That only works for positive integer powers. I think there is a workarounddefine (Num1) ^ (Num2)Please, correct me if I am wrong.
repeat (Num2)
set [output v] to ((output) * (Num1))
end
Still support
A complete workaround can be found here. As you can see it is quite long, although you can make it shorter if you don't need exact powers of 10.
- TheHockeyist
-
1000+ posts
Powers
That only works for positive integer powers. I think there is a workarounddefine (Num1) ^ (Num2)Please, correct me if I am wrong.
repeat (Num2)
set [output v] to ((output) * (Num1))
end
Still support
A complete workaround can be found here. As you can see it is quite long, although you can make it shorter if you don't need exact powers of 10.
And I hate the fact that Scratch only uses 14 sig figs. MOAR PLZ!
- Zambonifofex
-
100+ posts
Powers
([e ^ v] of ((base) * ([ln v] of (power))))or
([10 ^ v] of ((base) * ([log v] of (power))))
Last edited by Zambonifofex (Nov. 11, 2014 23:35:39)
- XGamer01
-
500+ posts
Powers
SupportSupport. Why doesn't this exist yet?Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
Support!
- lalala3
-
100+ posts
Powers
Nope. First of all, base and power should be switched. Second of all, that doesn't work with negative bases.([e ^ v] of ((base) * ([ln v] of (power))))or([10 ^ v] of ((base) * ([log v] of (power))))
- RPFluffy
-
1000+ posts
Powers
([e ^ v] of ((base) * ([ln v] of (power))))or([10 ^ v] of ((base) * ([log v] of (power))))
Doesn't work, been tested.
Support, I bet you mean this:
(() ^ () :: operators)
Last edited by RPFluffy (Nov. 12, 2014 01:23:52)
- MegaApuTurkUltra
-
1000+ posts
Powers
Support!SupportSupport. Why doesn't this exist yet?Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
Support!
- Firedrake969
-
1000+ posts
Powers
!troppuSSupport!SupportSupport. Why doesn't this exist yet?Support.Support, even though it has been suggested innumerable times before.Support(+1) Support, although it has been suggested before.
I think it should look like(() ^ () :: operators)it is probably more recognised than **
Support!
- 20btheilmanngohr
-
100+ posts
Powers
define (Num1) ^ (Num2)
if <(Num2) > (0)> then
repeat (Num2)
set [output v] to ((output) * (Num1))
end
else
repeat ((0) - (Num2))
set [output v] to ((output) * (Num1))
end
end
Last edited by 20btheilmanngohr (Nov. 12, 2014 04:02:47)