Page 1 of 1

Why is (-1)^1.2 not defined?

Posted: Mon May 04, 2015 1:47 pm
by Bindie
Hey, little math problem as mentioned.

Re: Why is (-1)^1.2 not defined?

Posted: Mon May 04, 2015 2:23 pm
by s-ol
Bindie wrote:Hey, little math problem as mentioned.
Because it is defined as the 6th root of -1, to the power of 5 (1.2 = 6/5). The root of negative numbers is not defined in general math.

Re: Why is (-1)^1.2 not defined?

Posted: Mon May 04, 2015 2:25 pm
by Bindie
Of course. There is no root of (-1), complex numbers. I didn't see 1.2 as a rational number. :) Like a (a/b) number.

Re: Why is (-1)^1.2 not defined?

Posted: Tue May 05, 2015 9:54 pm
by Muris
I would guess at least some math libraries would define it something as:
{ re = cos 1.2pi, im = sin 1.2pi }

and if not, you can probably define it yourself.

Re: Why is (-1)^1.2 not defined?

Posted: Wed May 06, 2015 6:57 pm
by Bindie
It's not that important, ^2 was too high so I figured I'd use ^1.2, however it didn't work with negative numbers and now I know why. Of course 1.2 is a a/b kind of numeral, and as S0lll0s said, more or less a root of a number.

Re: Why is (-1)^1.2 not defined?

Posted: Sun May 10, 2015 12:22 pm
by Ranguna259
Actualy there are roots for negative numbers but the index has to be odd:
Even index:

Code: Select all

(-1)^(1/2) = 2root-1 = i (or error)
Same goes for 4root, 6root, 8root, (2*x)root where x is a natural number

Odd index:

Code: Select all

(-1)^(1/3) = 3root-1 = -1
Same goes for 1root, 5root, 7root, (3*x)root where x is a natural number or 1/3

Re: Why is (-1)^1.2 not defined?

Posted: Sun May 10, 2015 1:53 pm
by zorg
Ranguna259 wrote:Actualy there are roots for negative numbers but the index has to be odd:
...

Code: Select all

(-1)^(1/3) = 3root-1 = -1
Except lua still won't calculate that with the default lib routines; it gives -nan in the online interpreter.