Discuss Scratch
- Discussion Forums
- » Suggestions
- » Could we please have an exponents block? ( ) ^ ( )
- ixvizikil
-
Scratcher
52 posts
Could we please have an exponents block? ( ) ^ ( )
I've heard people say it would be too advanced for Scratch, but Scratch already has sin, cos, tan, log, and more.I don't understand why a CHILDREN's website would have such complicated mathematics.
Anyways, support. We need this.
It's not so complicated.
x^5 is just basically x*x*x*x*x, x^2 is just x*x…
It would help a lot to have ^ for cases where it is difficult or long to code (5^2.5 isn't easy to calculate)
If people don't know what something does, they either don't use it or search what it does.
(for an example, I never use log)
Also, scratch is SUPPOSED to teach how to code.
In other coding languages, you most of the time have to search what a function does.
Anyway, it's quite difficult to make, and it is useful.
if you still think it's too complicated, ST could just make an ‘advanced math’ extension.
It could contain ^, Atan2, and a quite a few other mathematical functions, as well as >=, <=, …
Last edited by ixvizikil (Aug. 17, 2026 15:02:46)
- CuddlyGrouse
-
Scratcher
40 posts
Could we please have an exponents block? ( ) ^ ( )
Yeah, ^ is very simple, It is repeated multiplication, And can be quite useful. Also, it is quite silly of Scratch not to add it, because recreating it with
([tan v] of ()::operators)and
([10^ v] of ()::operators)can return slightly incorrect values.
- unnor
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Yeah, ^ is very simple, It is repeated multiplication, And can be quite useful. Also, it is quite silly of Scratch not to add it, because recreating it with6^-2.125 =([tan v] of ()::operators)and([10^ v] of ()::operators)can return slightly incorrect values.
- r3hehehehehhe
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Yes because it's near impossible to recreate
- Haycat2009
-
Scratcher
500+ posts
Could we please have an exponents block? ( ) ^ ( )
Complicated? You are behind the times.I've heard people say it would be too advanced for Scratch, but Scratch already has sin, cos, tan, log, and more.I don't understand why a CHILDREN's website would have such complicated mathematics.
Anyways, support. We need this.
Its actually much easier than many things like trig, logarithms, and the lot.
- ixvizikil
-
Scratcher
52 posts
Could we please have an exponents block? ( ) ^ ( )
The principle is simple.Yeah, ^ is very simple, It is repeated multiplication, And can be quite useful. Also, it is quite silly of Scratch not to add it, because recreating it with6^-2.125 =([tan v] of ()::operators)and([10^ v] of ()::operators)can return slightly incorrect values.
Of course, some equations are difficult to calculate, which is why we need it in the first place.
If you could just do
repeat pow:
set result to ((result)*(base)),
We wouldn't need so much this block.
Last edited by ixvizikil (Aug. 19, 2026 08:01:04)
- Assycot243
-
Scratcher
53 posts
Could we please have an exponents block? ( ) ^ ( )
The nonexistence of
(() ^ () ::operators)is especially weird given that
([e ^ v] of ())and
([10 ^ v] of ())already exist.
- bitmap_caketin
-
Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
If you need negative numbers, use:
(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- Assycot243
-
Scratcher
53 posts
Could we please have an exponents block? ( ) ^ ( )
If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
- AndPherbCodes
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Multiplication is just repeated addition.snippity snip snipThe principle is simple.
Of course, some equations are difficult to calculate, which is why we need it in the first place.
If you could just do
repeat pow:
set result to ((result)*(base)),
We wouldn't need so much this block.
But it gets more complicated when you factor in negatives and fractions and decimals.
Same for exponents.
By your logic we should just get rid of multiplication.
Last edited by AndPherbCodes (Aug. 19, 2026 14:53:41)
- bitmap_caketin
-
Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
I expect OP could've done it a bit faster than waiting thirteen years and counting.If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
Also, the floating-point error is unavoidable in the maths system that scratch uses
Last edited by bitmap_caketin (Aug. 19, 2026 17:29:45)
- Mimi-EEEEE
-
Scratcher
500+ posts
Could we please have an exponents block? ( ) ^ ( )
Eh IDK. Some Scratch mods have exponent blocks, and they dont have too many of those errors.I expect OP could've done it a bit faster than waiting thirteen years and counting.If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
Also, the floating-point error is unavoidable in the maths system that scratch uses

- VictoryVonDoom
-
Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
Eh IDK. Some Scratch mods have exponent blocks, and they dont have too many of those errors.I expect OP could've done it a bit faster than waiting thirteen years and counting.If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
Also, the floating-point error is unavoidable in the maths system that scratch uses
((0) - ((0) * (0)))or
((0) * (() - (0)))not sure but ye
Last edited by VictoryVonDoom (Aug. 19, 2026 22:55:47)
- scratchy_boy106
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
To make it output 8, just pop a round block somewhere.If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
- TheRealAL2009
-
Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
Yeah, but suppose it was:To make it output 8, just pop a round block somewhere.If you need negative numbers, use:these workarounds have two problems:(([e v] of (([ln v]of(base))*([abs v] of (exponent)))::operators)*((1)-((2)*((([floor v] of (exponent))mod(2))*<(base)<(0)>)))
- they're not obvious at the skill level where the exponent block would start to be helpful (that is probably clumsily stated)
- the errors show even for small numbers (2 ^ 3 should be eight but the workaround gives 7.999999999999998)
3.2 ^ 5
= 3.2 * 3.2 * 3.2 * 3.2 * 3.2
= 335.54432 (exactly that, it's not rounded)
While scratch's e^5ln(3.2) workaround might give something like 335.5443199999…
You would have to do something more complex to find which decimal places are just floating point error. Maybe if you multiply it by ten, various numbers of times, then round it and check the difference to see how close the decimal part is to 0 / 1.
But that's a bit of a hassle.
- hotcrystal
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Yeah, but suppose it was:It's called floating point imprecision, and unfortunately, there is no solution to that.
3.2 ^ 5
= 3.2 * 3.2 * 3.2 * 3.2 * 3.2
= 335.54432 (exactly that, it's not rounded)
While scratch's e^5ln(3.2) workaround might give something like 335.5443199999…
You would have to do something more complex to find which decimal places are just floating point error. Maybe if you multiply it by ten, various numbers of times, then round it and check the difference to see how close the decimal part is to 0 / 1.
But that's a bit of a hassle.
- ixvizikil
-
Scratcher
52 posts
Could we please have an exponents block? ( ) ^ ( )
I think the problem is not that we have imprecision (I don't know if ST could even avoid them by using complex code),Yeah, but suppose it was:It's called floating point imprecision, and unfortunately, there is no solution to that.
3.2 ^ 5
= 3.2 * 3.2 * 3.2 * 3.2 * 3.2
= 335.54432 (exactly that, it's not rounded)
While scratch's e^5ln(3.2) workaround might give something like 335.5443199999…
You would have to do something more complex to find which decimal places are just floating point error. Maybe if you multiply it by ten, various numbers of times, then round it and check the difference to see how close the decimal part is to 0 / 1.
But that's a bit of a hassle.
but that it's complex to build (I don't know anything about log, so I wouldn't be able to code the workaround myself).
- ILuvDogs-5335
-
Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
Yeah, but suppose it was:It's called floating point imprecision, and unfortunately, there is no solution to that.
3.2 ^ 5
= 3.2 * 3.2 * 3.2 * 3.2 * 3.2
= 335.54432 (exactly that, it's not rounded)
While scratch's e^5ln(3.2) workaround might give something like 335.5443199999…
You would have to do something more complex to find which decimal places are just floating point error. Maybe if you multiply it by ten, various numbers of times, then round it and check the difference to see how close the decimal part is to 0 / 1.
But that's a bit of a hassle.
Ehh, it's okay.
- unnor
-
Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
-2.45^-2.125 =I think the problem is not that we have imprecision (I don't know if ST could even avoid them by using complex code),Yeah, but suppose it was:It's called floating point imprecision, and unfortunately, there is no solution to that.
3.2 ^ 5
= 3.2 * 3.2 * 3.2 * 3.2 * 3.2
= 335.54432 (exactly that, it's not rounded)
While scratch's e^5ln(3.2) workaround might give something like 335.5443199999…
You would have to do something more complex to find which decimal places are just floating point error. Maybe if you multiply it by ten, various numbers of times, then round it and check the difference to see how close the decimal part is to 0 / 1.
But that's a bit of a hassle.
but that it's complex to build (I don't know anything about log, so I wouldn't be able to code the workaround myself).
- Discussion Forums
- » Suggestions
-
» Could we please have an exponents block? ( ) ^ ( )