BALA Posted January 30, 2007 Posted January 30, 2007 I'm trying to find teh square root of a negative number. I have a script like this: $x = Sqrt(-9) MsgBox(0, "test", $x) Though It keeps on producing "-1.#IND" but I'm expecting the imaginary number "3i" Are imaginary numbers a limitation in the AutoIt language or am I just doing this the wrong way? [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Shevilie Posted January 30, 2007 Posted January 30, 2007 That i would guess... no normal scriptlangues knows imaginary numbers (as far as I know) Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
BALA Posted January 30, 2007 Author Posted January 30, 2007 (edited) That i would guess... no normal scriptlangues knows imaginary numbers (as far as I know)Man, what a drag. That ruins my idea for a program that will solve polynomials.EDIT: I think I have a work around that I could use. Anyways, thanks for the help Sheville Edited January 30, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Uten Posted January 31, 2007 Posted January 31, 2007 (edited) If you think a little outside the box. Autoit can handle them. Just use arrays with two entries one for the real and one for the imaginary part. The only thing is that you have to use functions to manipulate the variables. Func IVAdd(ByRef arg1, ByRef arg2) ;Possibly check that the array is size2 and is an array Local $ret[2] $ret[0] = $arg1[0] + $arg2[0] $ret[1] = $arg2[1] 0 $arg2[1] Return $ret EndFunc Not as nice and cool, and fast, as it is possible to do it in C/C++ but it works. You should probably be able to find libraries you could use to on the net. EDIT: Typo Edited January 31, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now