Discuss Scratch

savaka
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

Anyone know how to do this?

Last edited by savaka (Aug. 2, 2014 19:25:58)

Thepuzzlegame
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

Ignore this

Last edited by Thepuzzlegame (Aug. 2, 2014 19:12:48)


hi!
djdolphin
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

Math.sqrt()

!
goldfish678
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

With ProcessingJS, you just use
sqrt(num)
.
goldfish678
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

Thepuzzlegame wrote:

Can't you just use this?
([sqrt v] of (9))
Javascript, not Scratch…
Thepuzzlegame
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

goldfish678 wrote:

Thepuzzlegame wrote:

Can't you just use this?
([sqrt v] of (9))
Javascript, not Scratch…
Oh, I thought they were trying to write a JavaScript extension for scratch. My bad

Last edited by Thepuzzlegame (Aug. 2, 2014 19:11:45)


hi!
savaka
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

SORRY BIG MISTAKE I MEANT NTH ROOT
bobbybee
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

Math.pow(x, 1/n)

“Ooo, can I call you Señorita Bee?” ~Chibi-Matoran
savaka
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

bobbybee wrote:

Math.pow(x, 1/n)
Will that work in all cases?
bobbybee
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

savaka wrote:

bobbybee wrote:

Math.pow(x, 1/n)
Will that work in all cases?

Yes. By algebraic definition, the nth root of x equals x ^ (1/n). That's just the JavaScript equivalent.

“Ooo, can I call you Señorita Bee?” ~Chibi-Matoran
savaka
Scratcher
1000+ posts

JavaScript nth root function (that actually works)

bobbybee wrote:

savaka wrote:

bobbybee wrote:

Math.pow(x, 1/n)
Will that work in all cases?

Yes. By algebraic definition, the nth root of x equals x ^ (1/n). That's just the JavaScript equivalent.
Thanks! TOPIC CLOSED. (Oh yeah, not 24 hours yet. Reporting…)

Powered by DjangoBB