RevolutionGG
#40306525Tuesday, January 04, 2011 1:51 AM GMT

Wikipedia sez: i^4n = i i^(4n+1) = 1 i^(4n+2) = -i i^(4n+3) = -1
RevolutionGG
#40306601Tuesday, January 04, 2011 1:52 AM GMT

OOPS SORREH i^4n = 1 i^(4n+1) = i i^(4n+2) = -1 i^(4n+3) = -i
CardCaddy
#40306781Tuesday, January 04, 2011 1:54 AM GMT

Basically, thats right.
RevolutionGG
#40306816Tuesday, January 04, 2011 1:55 AM GMT

Thought so. :P
Shokwav
#40306841Tuesday, January 04, 2011 1:55 AM GMT

It's not complicated. local i={} setmetatable(i, {__add=function(a, b) if not (a==i or b==i) then return print(tostring(nil)) end if type(a)==i then return b.."i" else return a.."i" end end, }) local a = 12 + i print(a) 12i
vanillaluv
#40307044Tuesday, January 04, 2011 1:58 AM GMT

... You said it was complicated, therefore it is! You do not deny your own words, my brother! http://www.roblox.com/The-Roblox-Lua-math-i-library-v1-6-item?id=43522190 UPDATE: Added cube roots.
RevolutionGG
#40307111Tuesday, January 04, 2011 1:58 AM GMT

@Shok: You can't add an imaginary number and a real number.
Shokwav
#40307129Tuesday, January 04, 2011 1:59 AM GMT

By complicated, I meant inefficient.
Shokwav
#40307187Tuesday, January 04, 2011 1:59 AM GMT

@Revolution: I never tried to. Look at my code.
RevolutionGG
#40307201Tuesday, January 04, 2011 1:59 AM GMT

YOU CANNOT ADD AN IMAGINARY NUMBAH AND TEH REAL NUMBAH!!!!1!1!1!11!11!!!!1111!!ONE!1!
vanillaluv
#40307205Tuesday, January 04, 2011 2:00 AM GMT

T_T Guys, stop if you're just going to make a replacement for my script... D:
Shokwav
#40307230Tuesday, January 04, 2011 2:00 AM GMT

I.never.tried.to.
vanillaluv
#40307247Tuesday, January 04, 2011 2:00 AM GMT

@Shokky Cover of a mistake.
RevolutionGG
#40307282Tuesday, January 04, 2011 2:00 AM GMT

"local a = 12 + i" The answer is "12 + i". It's not "12i".
vanillaluv
#40307380Tuesday, January 04, 2011 2:02 AM GMT

You guys noticed my updates? http://www.roblox.com/The-Roblox-Lua-math-i-library-v1-6-item?id=43522190 If you're too lazy to take it, here's the code: --[[ math.i created by vanillaluv 2011 put no spaces ex: mathi(-9) ]] function mathi(equation) -- call the function a = equation*equation -- convert negative to positive b = math.sqrt(a) -- get the square root of the positive new number final = "The square root of "..equation.." is "..tostring(math.sqrt(b)).."i. " -- get the square root of the square root of the new positive number return final -- give us what you did end -- end the function -- put the rest of your script here, use this template for your math: print(mathi(-9)) -- [[ UPDATE: Allows cuberoots ]] function mathic(equation) a = equation*equation b = math.sqrt(a) c = b/3 d = math.sqrt(c) print("The cube root of "..equation.. " is "..d.."i. ") end print(mathic(-27)) -- NEXT UPDATE: dealing with floats print("NEXT UPDATE: dealing with floats")
Shokwav
#40307515Tuesday, January 04, 2011 2:03 AM GMT

I did that because there is no __pow metamethod.
vanillaluv
#40307549Tuesday, January 04, 2011 2:03 AM GMT

FAILLL SO TOTALLY FAILED THAT SO MUCH IN SO MANY WAYS
Shokwav
#40307884Tuesday, January 04, 2011 2:07 AM GMT

"function mathic(equation) a = equation*equation b = math.sqrt(a) c = b/3 d = math.sqrt(c) print("The cube root of "..equation.. " is "..d.."i. ") end " local mathic=function(a) b=(((a*a)^0.5)/3)^0.5 return a, print(string.format("Cubic root of %s: %s.", a, b)) end Seriously, aim for maximum efficiency.
Shokwav
#40307920Tuesday, January 04, 2011 2:08 AM GMT

Lol, how did I fail?
vanillaluv
#40307938Tuesday, January 04, 2011 2:08 AM GMT

@Shok Okay, I'll do that... :P
Fungalmungal
#40308007Tuesday, January 04, 2011 2:09 AM GMT

"function mathic(equation) a = equation*equation b = math.sqrt(a) c = b/3 d = math.sqrt(c) print("The cube root of "..equation.. " is "..d.."i. ") end " huh? Two things: First, cube roots of negative numbers are always real. Second, a cube root isn't just the square root of a number divided by three. It's the number that, when multiplied by itself three times, returns your original number.
Shokwav
#40308011Tuesday, January 04, 2011 2:09 AM GMT

...Except that my b would be better off local.
vanillaluv
#40308059Tuesday, January 04, 2011 2:09 AM GMT

No, you didn't fail, I failed. Look at my math. mathic(-64) > 4. ( one heck of a float here ) -.- So how would I do that?
vanillaluv
#40308112Tuesday, January 04, 2011 2:10 AM GMT

@Fungal I KNOW, I KNOW.
Fungalmungal
#40308126Tuesday, January 04, 2011 2:10 AM GMT

Lua can do cube roots of negative numbers by itself. print((-64)^(1/3))