1. Third-root

Greeetings everybody! (<= this was originally "Help,", but the list-server
rejected my message, because it thought I was sending a command...)

I need a function that can calculate the "third-root" of a number (I'm not
sure if it is called that in english, but I hope you understand what I
mean, like a=third_root(8), gives a=2). I didn't find such a routine in
Euphoria, and I do not know how to make it myself.

Thanx in advance,
Einar Mogen

new topic     » topic index » view message » categorize

2. Re: Third-root

On Fri, 25 Jul 1997, Einar Mogen wrote:
>
> I need a function that can calculate the "third-root" of a number (I'm not
> sure if it is called that in english, but I hope you understand what I
> mean, like a=third_root(8), gives a=2). I didn't find such a routine in
> Euphoria, and I do not know how to make it myself.

It's called the "cube root" in english.  2^3 is called "2 cubed" because
that's the volume (LxWxH)of a cube with sides of length 2 units.  2^2
is called "2 squared" because it's the area (LxW) of a square with sides
of length 2 units, and the second root is called "the square root."

Since we live in a 3D world, we normally just say "2 to the nth power" and
"nth root" for powers and roots 4 and above.

Michael Packard
Lord Generic Productions
lgp at exo.com http://exo.com/~lgp
A Crash Course in Game Design and Production
http://exo.com/~lgp/euphoria

new topic     » goto parent     » topic index » view message » categorize

3. Re: Third-root

Einar Mogen writes:
> I need a function that can calculate the "third-root" of a number (I'm not
> sure if it is called that in english, but I hope you understand what I
> mean, like a=third_root(8), gives a=2). I didn't find such a routine in
> Euphoria, and I do not know how to make it myself.

The n-th root of a number is the same as that
number raised to the power 1/n.

So the square root of x would be power(x, 1/2) or power(x, 0.5)
although sqrt(x) is faster.

The third-root or "cube root" would be power(x, 1/3)

Regards,
  Rob Craig
  Rapid Deployment Software

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu