Discuss Scratch
- Discussion Forums
- » Suggestions
- » "To the power of" operation
- elast27
-
2 posts
"To the power of" operation
PLEASEEEE make a “to the power of” operation (not just 10^ but any power)
This will be super useful for a project i'm working on
This will be super useful for a project i'm working on
- Paddle2See
-
1000+ posts
"To the power of" operation
Try this:
That should give you x raised to the y power.
That should give you x raised to the y power.
Last edited by Paddle2See (Dec. 6, 2014 02:50:13)
- nimrocco
-
100+ posts
"To the power of" operation
Try this:
That should give you x raised to the y power.
- VoltageGames
-
1000+ posts
"To the power of" operation
No support…
there's a workaround, I just don't know it…
there's a workaround, I just don't know it…
Last edited by VoltageGames (Dec. 6, 2014 17:47:14)
- TheHockeyist
-
1000+ posts
"To the power of" operation
Hmm… why can't the ST be more direct and include a power block? It would also eliminate “e^” and “10^” from the dropdown, so you lose two things and add one, meaning Scratch is one thing simpler.
- RDoc
-
46 posts
"To the power of" operation
Only for positive values of X though. Try this:
That should give you x raised to the y power.
This has been asked for many times and I don't see why it should be so difficult to implement, but anyway,
I think this is a pretty general solution:
Last edited by RDoc (Dec. 7, 2014 20:08:56)
- elast27
-
2 posts
"To the power of" operation
Thank you so much this really helped Try this:
That should give you x raised to the y power.

- lalala3
-
100+ posts
"To the power of" operation
This doesn't work for fractional powers. See RDoc's solution above. I think you should do this:
A workaround was given on the second post, its inability to handle negative bases aside. If you'd bothered to actually read the thread, you should have seen it. No support…
there's a workaround, I just don't know it…
I support this suggestion, despite its workarounds, because the exponent operator is a common and important one, used almost as often as addition, subtraction, multiplication, and division, and requiring users to use a workaround like RDoc's is even more egregious than Cyoce's example of
in almost every respect.
Edit: Link added.
Last edited by lalala3 (Dec. 10, 2014 00:59:56)
- Cyoce
-
500+ posts
"To the power of" operation
Support.
I was about to respond to
I was about to respond to
Talking about how Try this:the ability to compose a function of much more complicated functions does not invalidate said function, but
That should give you x raised to the y power.
This doesn't work for fractional powers. See RDoc's solution above. I think you should do this:A workaround was given on the second post, its inability to handle negative bases aside. If you'd bothered to actually read the thread, you should have seen it. No support…
there's a workaround, I just don't know it…
I support this suggestion, despite its workarounds, because the exponent operator is a common and important one, used almost as often as addition, subtraction, multiplication, and division, and requiring users to use a workaround like RDoc's is even more egregious than Cyoce's example ofin almost every respect.
Last edited by Cyoce (Dec. 10, 2014 00:52:42)
- Sillywilly24
-
6 posts
"To the power of" operation
This works 100 percent of the time
sets answer to x to the power of y
- Sillywilly24
-
6 posts
"To the power of" operation
my above solution can be simplified a lot but it works so whatever
- NilsTheBest
-
1000+ posts
"To the power of" operation
hi, thanks for helping but please don't necropost, this post was made years ago and probably has already been solved. Thanks ^^ This works 100 percent of the timesets answer to x to the power of y
- Inkulumo
-
500+ posts
"To the power of" operation
If the post is constructive (of which it is) and it is suggesting a workaround, it's allowed.hi, thanks for helping but please don't necropost, this post was made years ago and probably has already been solved. Thanks ^^ This works 100 percent of the timesets answer to x to the power of y
- space_elephant
-
500+ posts
"To the power of" operation
It would not remove e because the constant e in still required for scratch projects. It could be changed to Hmm… why can't the ST be more direct and include a power block? It would also eliminate “e^” and “10^” from the dropdown, so you lose two things and add one, meaning Scratch is one thing simpler.
- bbrainstormer
-
11 posts
"To the power of" operation
This works 100 percent of the timesets answer to x to the power of y
If the answer is complex it returns the absolute value with the sign of the real part.
- steve3rom
-
31 posts
"To the power of" operation
Try this:
That should give you x raised to the y power.
When I try this, inputting 2 as x and 3 as y I get 7.999999999997. However I should get 8. If I just put a round around the code, will it work? Thanks.
- Maximouse
-
1000+ posts
"To the power of" operation
If you only need integers, you can use round and it will work.Try this:
That should give you x raised to the y power.
When I try this, inputting 2 as x and 3 as y I get 7.999999999997. However I should get 8. If I just put a round around the code, will it work? Thanks.
- E_Equals_EmCeCube3
-
1000+ posts
"To the power of" operation
It looks like this idea has been suggested before in this topic.
Feel free to continue the discussion there so we can keep individual suggestions organized and in one topic.
Feel free to continue the discussion there so we can keep individual suggestions organized and in one topic.

- Super_Scratch_Bros20
-
1000+ posts
"To the power of" operation
Support. I know that there's a workaround, but if you think about it, LOTS of things have workarounds. We don't technically need variables; we can use lists. We don't need the
These features will simplify the amount of work that needs to be done. Again, support.
block or the
block; we can just use
. We don't need backdrops; we can just use sprites that look like backdrops.
These features will simplify the amount of work that needs to be done. Again, support.
- Discussion Forums
- » Suggestions
-
» "To the power of" operation