Discuss Scratch
- Discussion Forums
- » Suggestions
- » Could we please have an exponents block? ( ) ^ ( )
- ProdigyZeta7
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
And to prove this works:([10 ^ v] of ((power) * ([log v] of (base))))
10 ^ (b log a) = x >Setting up the equation
log 10 ^ (b log a) = log x >Property of logarithms
(b log a) log 10 = log x >Bringing the exponent down
b log a = log x >log 10 = 1
log (a ^ b) = log x >Bringing the exponent back to the base
a ^ b = x >Getting rid of log
- Firedrake969
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
-5^2.
I support… the workaround doesn't perfectly work.
log base X of a negative number is undefined. (unless in some rare cases the base is negative, but that doesn't happen in Scratch)
I support… the workaround doesn't perfectly work.
log base X of a negative number is undefined. (unless in some rare cases the base is negative, but that doesn't happen in Scratch)
Last edited by Firedrake969 (Nov. 17, 2013 20:53:34)
'17 rickoid
bf97b44a7fbd33db070f6ade2b7dc549
- 1234abcdcba4321
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Well, you could always do
if <(base) > [0]> then
([10 ^ v] of ((power) * ([log v] of (base))))
else
((0) - ([10^ v] of ((power) * ([log v] of ([abs v] of (base))))))
end
I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
- Firedrake969
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Bumping because of a duplicate I found.
The workaround doesn't allow for negative numbers. ^ does.
The workaround doesn't allow for negative numbers. ^ does.
'17 rickoid
bf97b44a7fbd33db070f6ade2b7dc549
- seanbobe
- Scratcher
500+ posts
Could we please have an exponents block? ( ) ^ ( )
correct I understand all these work, but wouldn't a block be way easier for new Scratchers? I have no idea what logarithms are.
you dont teach logarithms in 5th grade!
- Firedrake969
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Some of us did
But yeah, for some odd reason, kids are taught exponents way before logs, but logs and exponents are analogous to multiplication and division.
But yeah, for some odd reason, kids are taught exponents way before logs, but logs and exponents are analogous to multiplication and division.
'17 rickoid
bf97b44a7fbd33db070f6ade2b7dc549
- mitchboy
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
you call that huge? that's a rather simple script. Even better than that huge script: this block!
yes it does. all you have to do is add this: Bumping because of a duplicate I found.
The workaround doesn't allow for negative numbers. ^ does.
if <(x) < [0]> then
set [result v] to ((1) / (result))
end
and tell me one other reason to add this other than for making a calculator. sorry, but i think this is very low on the st's priorities.
Last edited by mitchboy (Nov. 20, 2013 00:12:56)
Capsicum annuum.
- mathfreak231
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Last time I checked, 0^0 was undefined.define result = (x) ^ (y)
if <(y) = [0]> then
set [result v] to [1] // yes, we also include 0^0=1 :O
i have grown as a person. and ive grown, literally. none of my posts from before 2022 represent me accurately.
- DadOfMrLog
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Technically, it's an " Last time I checked, 0^0 was undefined. indeterminate form", yes.
However, for practical computation it's typically given the value one - and doing that also helps along several useful mathematical theorems…
(EDIT: actually, wikipedia gives a really decent overview of the 0^0 question, including treatment on computers.)
The workaround doesn't allow for negative numbers. ^ does.See my (supposedly really long) script for a slightly more thorough treatment of negative numbers.
However, note that a^b with both a & b negative (and b not an integer) is certainly not for the faint-hearted - I'd be really interested to know how the proponents of the a^b block would see it behaving under such situations…
Last edited by DadOfMrLog (Nov. 20, 2013 02:26:36)
Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…
- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -
- jh1234l
- Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
like 5^2 = 25, or 2^3 = 8. power what do you mean power?
(^ is power)
Basically, if you have 5^5, it is 5x5x5x5x5. If you have 5^4, it is 5x5x5x5, and so on.
Basically, is the number multiplying by itself that many times.
Two Advertising and sharing groups:
Scratch Cat's Hideout: Home Page / Advertise! / Members / Write A Review / Read A Review / FAQs
Scratching fame:
- jh1234l
- Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
A () ^ () block is not necessary right now, as you could just use the workaround and add a script to check if it is zero.
However, it is certainly nice to have.
However, it is certainly nice to have.
Two Advertising and sharing groups:
Scratch Cat's Hideout: Home Page / Advertise! / Members / Write A Review / Read A Review / FAQs
Scratching fame:
- 1234abcdcba4321
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
And, wouldn't the workaround work, if you just put an abs() around the base value?
I'd highly appreciate it if you were to follow me. Don't forget to go to my profile.
All of my programming suggestions <— You should really get the suggestions move back to the suggestions forum!
Five hundred posts! I never expected to get up there… In only 2-3 months.
Does anyone know what a signature is? I mean, I've already seen 6-7 people get confused.
- goldfish678
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
I think the scratch team might have said they're not going to add it and there's a workaround.
- Photoguy77
- Scratcher
100+ posts
Could we please have an exponents block? ( ) ^ ( )
I certainly support this!
-Photoguy77
“Without enjoying, one will never truly learn” ~Flome
“Finding happiness starts in you” ~ProdigyZeta7
- savaka
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
Scratch is made to be for kids to learn how to program. It's not for professionals. I don't know how to use trigonometry to move a sprite. by this logic, we can remove “move (10) steps”
why not just usego to x: ((x position) + ([cos v] of ((direction)*(amt)))) y ((x position) + ([sin v] of ((direction)*(amt))))i mean jeez so simple
- supero
- Scratcher
11 posts
Could we please have an exponents block? ( ) ^ ( )
Or this too!
Just keep repeating it as many powers as you need it to.
((x) * ((x) * ((x) * (.....))))
Just keep repeating it as many powers as you need it to.
Last edited by supero (Dec. 23, 2013 00:58:44)
"I always finish projects last in school; not because I had no ideas, but because I had too many." -Me.
- savaka
- Scratcher
1000+ posts
Could we please have an exponents block? ( ) ^ ( )
This makes me think, they should add this:
(() √ ()) // category=operators
Last edited by savaka (Dec. 26, 2013 23:17:03)
- frodewin
- Scratcher
500+ posts
Could we please have an exponents block? ( ) ^ ( )
Support for a new ((x) ^ (y)) block.
1. it is simpler than other solutions
2. it is faster than other solutions
3. at least in the form ((x) ^ (2)) it will be used a lot
4. young scratchers (below 10) might not know what ^is, but the same holds for log, sin, cos, mod, … - at least the code of others becomes easier to read
1. it is simpler than other solutions
2. it is faster than other solutions
3. at least in the form ((x) ^ (2)) it will be used a lot
4. young scratchers (below 10) might not know what ^is, but the same holds for log, sin, cos, mod, … - at least the code of others becomes easier to read
((x) ^ (y))(but in green)
Last edited by frodewin (Dec. 23, 2013 18:06:47)
- mariobros406
- Scratcher
500+ posts
Could we please have an exponents block? ( ) ^ ( )
You mean like
(() ^ ()) // category=operatorsAnyway…
That block kinda already exists: This makes me think, they should add this:(() √ ()) // category=operators
([sqrt v] of ())Also, that block would make you input the answer. It would be a boolean block, not a reporter block.
Last edited by mariobros406 (Dec. 23, 2013 21:02:41)
I only check in to Scratch from time to time to see what others have been up to. I don't really post anything anymore. I'll occasionally post a question in the AT forum if I can't find an answer anywhere else.
- Discussion Forums
- » Suggestions
- » Could we please have an exponents block? ( ) ^ ( )