lopolop Posted February 9, 2006 Share Posted February 9, 2006 what does #IND mean... i am making a quadratic calculator and there is a formula i put in it seems to work i will do more tests to check but it looks all right... if you dont no the formula to find the solutions of a quadratic/parabola is [-$B +- Sqrt( $B^2-4*$A*$B)]/2*$A for some reason i most of the time get a answer of 1.#IND, 1.#IND i dont understand... Link to comment Share on other sites More sharing options...

Developers Jos Posted February 9, 2006 Developers Share Posted February 9, 2006 what does #IND mean... i am making a quadratic calculator and there is a formula i put in it seems to work i will do more tests to check but it looks all right... if you dont no the formula to find the solutions of a quadratic/parabola is [-$B +- Sqrt( $B^2-4*$A*$B)]/2*$A for some reason i most of the time get a answer of 1.#IND, 1.#IND i dont understand...#IND means division by zero SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...

cdkid Posted February 9, 2006 Share Posted February 9, 2006 (edited) did a quick search in the hepfile and found theseunder Log function:Return values:Failure: Tends to return -1.#IND for non-positive parameters. under the ACos function:Remarks:ACos(x) is mathematically defined only for -1 < x < 1, so ACos tends to return -1.#IND for other values of x.Under the ASin function:Remarks:ASin(x) is mathematically defined only for -1 < x < 1, so ASin tends to return -1.#IND for other values of x.Under the Mod function:Return Values:Failure: Returns -1.#IND if the divisor is zero.--hope this helps~cdkid Edited February 9, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...

lopolop Posted February 9, 2006 Author Share Posted February 9, 2006 ok i think it returns that when there are no solutions. Thanks! Link to comment Share on other sites More sharing options...

MSLx Fanboy Posted February 10, 2006 Share Posted February 10, 2006 (edited) You need to do error checking before calculating it. Pardon my C/AutoIt, I haven't touched an au3 file in days ;(-b +- sqrt(b^2-4ac))/(2a) if (a == 0) break; //division by zero discriminant = b^2-4ac if (discriminant < 0) //imaginary numbers break; if (discriminant == 0) //one real solution answer = -b/(2a) if (discriminant > 0){ //two real solutions Dim answer[2] answer[0] = (-b+sqrt(discriminant))/(2a) answer[1] = (-b-sqrt(discriminant))/(2a) } Hope you understand Edited February 10, 2006 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...

## 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 account## Sign in

Already have an account? Sign in here.

Sign In Now