Could we please have an exponents block? ( ) ^ ( )
id: 2860
category: Suggestions
posts: 492
Mar 6, 2013 05:15:16
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
illusionist
loading
Could we please have an exponents block?
Right there in operators with the other math blocks:
( ) + ( )
( ) - ( )
( ) / ( )
( ) * ( )
( ) ^ ( ) <———
It can't take more than a few seconds to add, can't it?
Right there in operators with the other math blocks:
( ) + ( )
( ) - ( )
( ) / ( )
( ) * ( )
( ) ^ ( ) <———
It can't take more than a few seconds to add, can't it?
Mar 6, 2013 15:06:34
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Hardmath123
loading
+1 This is totally worth it!
Mar 6, 2013 16:57:42
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
OrcaCat
loading
+1
Mar 6, 2013 17:48:13
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
coinman
loading
+1
Mar 6, 2013 17:57:54
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
LiFaytheGoblin
loading
this would be so cool! +1
Mar 6, 2013 19:16:46
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Programmer_112
loading
+1. Although I think there is a workaround.
Mar 7, 2013 00:08:53
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Wes64
loading
Mar 7, 2013 00:49:19
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
OrcaCat
loading
i made oneIt also isn't a reporter block
its not perfect but it works.
Is it possible to hack a reporter block?
Mar 7, 2013 16:03:25
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
bobbysq
loading
It used to be somewhat possible. Then it was fixed. You would just put %(something) in a variable but I forgot how it worked or if it did anything at all.i made oneIt also isn't a reporter block
its not perfect but it works.
Is it possible to hack a reporter block?
Mar 7, 2013 20:38:02
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
lunaluvgood
loading
+1
but while you are at it, add a square root block.
but while you are at it, add a square root block.
Mar 7, 2013 21:19:51
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
lalala3
loading
There is already one in there. +1
but while you are at it, add a square root block.
Mar 7, 2013 21:35:56
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
ImagineIt
loading
i made oneThat doesn't work with negatives.
its not perfect but it works.
Mar 8, 2013 00:43:35
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
OrcaCat
loading
There is already one in there. +1
but while you are at it, add a square root block.
And if there wasn't, do (x)^(0.5)
Mar 8, 2013 00:56:45
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
veggieman001
loading
Nothing is permanent.
Mar 8, 2013 05:55:18
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
thebriculator
loading
There is a workaround.
I'll try to express it without scratchblocks.
(10 ^ ) of (log(2) * (10))
where you're finding 2^10
Square roots: (and any roots)
(10 ^) of (log(8) / (3))
where you're finding the cube root of 8
obviously these do not work with exponents or roots of zero.
anyway I still +1 this block
I'll try to express it without scratchblocks.
(10 ^ ) of (log(2) * (10))
where you're finding 2^10
Square roots: (and any roots)
(10 ^) of (log(8) / (3))
where you're finding the cube root of 8
obviously these do not work with exponents or roots of zero.
anyway I still +1 this block
Mar 9, 2013 16:45:26
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
IanSan5653
loading
+100! This seems so simple, yet essential.
Mar 9, 2013 18:38:06
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Wes64
loading
it doesn't need to be you still get the number you need.i made oneIt also isn't a reporter block
its not perfect but it works.
Mar 9, 2013 19:59:02
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
OrcaCat
loading
Yeah, true.it doesn't need to be you still get the number you need.i made oneIt also isn't a reporter block
its not perfect but it works.
But I still can't wait until custom reporters.
Mar 10, 2013 01:06:05
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
veggieman001
loading
Nothing is permanent.
Mar 10, 2013 01:46:55
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
OrcaCat
loading
Yeah… I wasn't sure what the relationship of Natural Log and e was. But I thought it was something with square roots because of what you said.Disregard this post, I thought you said the sqrt block didn't work with negatives (probably thought you were quoting the post above yours)That's because negative numbers don't have real square roots and Scratch doesn't support complex numbers.i made oneThat doesn't work with negatives.
its not perfect but it works.
Lol. I could've just done this.
Jul 4, 2013 02:52:59
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
( ( var ) ^ ( var ) )
PPPPPPPLLLLLLLLLLLLLZZZZZZZZZZZZ!!!!!!!!!!!!!!!!!!!
PPPPPPPLLLLLLLLLLLLLZZZZZZZZZZZZ!!!!!!!!!!!!!!!!!!!
Jul 4, 2013 02:53:32
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
dracae
loading
I support.
(EDIT: There's a workaround though, so…)
(EDIT: There's a workaround though, so…)
Jul 4, 2013 02:55:18
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
But what if we wanted to do x^50 or something? Why use 50 blocks when you could use 1?
EDIT: Support (though I started this post topic, so…)
EDIT: Support (though I started this post topic, so…)
Jul 4, 2013 02:56:24
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
mitchboy
loading
You wouldn't need 50 blocks. I'm currently working on a x^y custom block right now, if you're interested. But what if we wanted to do x^50 or something? Why use 50 blocks when you could use 1?
Jul 4, 2013 02:57:18
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
Thanks. (I have Scratch 2.0, never heard of 1.4…)
Jul 4, 2013 03:01:51
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
dracae
loading
There's some log things that works… Thanks. (I have Scratch 2.0, never heard of 1.4…)
Jul 4, 2013 03:03:42
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
But what if we wanted, for example 84 ^ 59? There's no block for that.
Jul 4, 2013 03:33:47
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
mitchboy
loading
There now is. But what if we wanted, for example 84 ^ 59? There's no block for that.
This project.
EDIT: 84 ^ 59 = 3.40782965354148e+113. Boom.
Jul 4, 2013 03:36:01
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
But I wanted a block that you could link to other blocks, not a project.
EDIT: An operator block.
EDIT: An operator block.
Jul 4, 2013 03:37:54
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
mitchboy
loading
You can go see inside, drag the custom block script into your backpack, and boom! You now have a x ^ y block! (Note: requires a variable named Result.) But I wanted a block that you could link to other blocks, not a project.
EDIT: An operator block.
Jul 4, 2013 03:40:06
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
…I want it implemented so that EVERY SCRATCH USER can have one, not just the code geeks.
Jul 4, 2013 03:59:15
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
kayybee
loading
Actually, that's not the problem. You can do set X to 1, and repeat {set X to X*84} 59 times. But what if we wanted, for example 84 ^ 59? There's no block for that.
The problem is like 84^(pi) or stuff. You can't repeat something pi times.
So we use logs.
But younger scratchers might not know logs, and you can't create custom returning values right now, so this would be good.
But saying PPPPPPPPLLLLLLLLLZZZZZZZ just makes you seem immature, so it's not the greatest idea to put that in your suggestion.
Jul 4, 2013 04:01:45
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
8solarplanets
loading
It's like a demand, e.g. I WANT CAKE AND IF I DO NOT GET 49620672093657 SLICES I WILL GO ON STRIKE AND AVOID WORK!!!!!!!!!!!
Jul 4, 2013 05:35:27
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
ProdigyZeta7
loading
Calm down, please. What you ask is already suggested before several times. And don't worry, I'm sure at some point they'll add the exponent block.
The workarounds goes like this:
The workarounds goes like this:
//short version
x ^ y = 10 ^ (y * log x)
//long version
if y = 0
set x = 1
else
tempx = x
repeat (y - 1)
x = x * tempx
Jul 4, 2013 07:22:10
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
kayybee
loading
Calm down, please. What you ask is already suggested before several times. And don't worry, I'm sure at some point they'll add the exponent block.
The workarounds goes like this://short version
x ^ y = 10 ^ (y * log x)
//long version
if y = 0
set x = 1
else
tempx = x
repeat (y - 1)
x = x * tempx
your “long version” workaround isn't really the same as te short version.
The short version works for all real numbers, the long one doesn't.
Jul 4, 2013 17:07:25
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
mitchboy
loading
Actually, 3.14 ^ 3.14 results in 30.959 on my custom block (about seven posts above). Try it. It just doesn't work with negative numbers or fractions. And my project barely involves any heavy scripting or math at all. All you need is: The short version works for all real numbers, the long one doesn't.
- three variables
- a repeat block
- a subtraction and a multiplication block
- a set variable block
That's it. It took me like two minutes.
Nov 27, 2013 12:53:41
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Photoguy77
loading
I certainly support this!
Oct 16, 2014 19:32:02
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
RalphMath
loading
Please, please, please add this as an operator just like +-*/ it's a real limitation when teaching a lot of math concepts not to have exponentiation.
Oct 16, 2014 20:02:57
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Iditaroid
loading
I know this is technically necroposting but you raise a good point! An exponent block would certainly make things easier for teachers working with Scratch! Please, please, please add this as an operator just like +-*/ it's a real limitation when teaching a lot of math concepts not to have exponentiation.
Oct 16, 2014 20:41:29
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Cyoce
loading
Support
((0) ^ (0) :: operators)
Oct 16, 2014 21:06:13
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
theonlygusti
loading
Support, even though
((base) ^ (log) :: operators)is exactly the same as
([10^ v] of ((log) * ([log v] of (base) :: operators)) :: operators)
Oct 16, 2014 22:46:40
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Cyoce
loading
That project doesn't work. It doesn't even work for all integers, let alone decimals. Not sure how to get exponents for decimals, but here's how it works for integers:There now is. But what if we wanted, for example 84 ^ 59? There's no block for that.
This project.
EDIT: 84 ^ 59 = 3.40782965354148e+113. Boom.
define exponentify (x), (y)
set [result v] to [1]
if <(y) > [0]> then
repeat (y)
set [result v] to ((result) * (x))
end
else
repeat (y)
set [result v] to ((result) / (x))
Oct 16, 2014 22:51:35
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
lalala3
loading
Like so:
Well, not really. The “base” and the “log” should be switched, but whatever. The problem with this is that the very idea that one might be forced to do this is fundamentally absurd for reasons that should be clear to anyone who's learned about logarithmic functions in math class. Support, even though((base) ^ (log) :: operators)is exactly the same as([10^ v] of ((base) * ([log v] of (log) :: operators)) :: operators)
Oct 16, 2014 22:54:39
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
lalala3
loading
No. Technically, it's only necroposting if the topic has been resolved. It's just that people don't think and instead pull out their torches and pitchforks whenever someone posts on an old thread, regardless of whether the topic has actually been resolved, so the word (as well as the concept) has become depreciated.I know this is technically necroposting but you raise a good point! An exponent block would certainly make things easier for teachers working with Scratch! Please, please, please add this as an operator just like +-*/ it's a real limitation when teaching a lot of math concepts not to have exponentiation.
Oct 18, 2014 16:42:10
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
lalala3
loading
Reposting from another thread, because it's relevant:
I just figured out something. Neither of the workarounds are perfect. The one using loops has issues with raising numbers to negative or fractional powers, while the other workaround (using logs) doesn't work if the base isn't positive. I thus propose the following solution:Define (base) ^ (exponent)Can we have a proper exponent block now? Please?
if <(base :: custom) > (0)> then
set [answer v] to ([10 ^ v] of ((exponent) * ([log v] of (base))))
else
if <((exponent) mod (1)) = (0)> then
set [answer v] to [1]
repeat ([abs v] of (exponent))
set [answer v] to ((answer) * (base))
end
if <(exponent) < (0)> then
set [answer v] to ((1)/(answer))
end
else
set [answer v] to [undefined]
end
end
Nov 13, 2014 18:20:01
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
RalphMath
loading
Well, the actual value of 3.14 ^ 3.14 is approximately 36.3378. Anyone considering writing an exponentiation block really needs to understand how logarithms and powers work.Actually, 3.14 ^ 3.14 results in 30.959 on my custom block (about seven posts above). Try it. It just doesn't work with negative numbers or fractions. And my project barely involves any heavy scripting or math at all. All you need is: The short version works for all real numbers, the long one doesn't.
- three variables
- a repeat block
- a subtraction and a multiplication block
- a set variable block
That's it. It took me like two minutes.
Nov 13, 2014 19:40:40
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
RalphMath
loading
Here's my attempt, it might be a bit faster for large negative exponents since it doesn't loop.
define exp (value, power)
if <<[value] < [0 ]> and << [power] mod [1]> > [0]>> then
set [answer] to [ ]
else
set [answer] to ([e^ v] of ([power] * ([ln v] of ([abs v] of [value])))
if <([value] < [0]) and (([power] mod [2]) = [1])> then
set [answer] to ([answer] * [-1])
end
Dec 17, 2015 12:19:50
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
DownsGameClub
loading
Lets keep the spam down.
As for the suggestion, I would support. It would not be very easy using those
As for the suggestion, I would support. It would not be very easy using those
(((((((((...) * (0)) * (0)) * (0)) * (0)) * (0)) * (0)) * (0)) * (0))blocks…
Jan 14, 2016 01:30:18
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
Tymewalk
loading
Support. There's no reason not to have this, seeing as how the workarounds (even just multiplying several times) get out of hand quickly.
Jan 15, 2016 13:58:59
Could we please have an exponents block? ( ) ^ ( )
view on scratch
view on legacy ocular
TheLogFather
loading
If this is going to be the ‘official’ exponent suggestion topic, then I guess I'd better make sure there's a link to this in here:
- https://scratch.mit.edu/projects/16871883/ -
Note the features, which deal with some of the issues mentioned here when using the e^/ln workaround.
- https://scratch.mit.edu/projects/16871883/ -
Note the features, which deal with some of the issues mentioned here when using the e^/ln workaround.