Jump to content
Sign in to follow this  
lopolop

#IND?

Recommended Posts

lopolop

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...


Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
cdkid

did a quick search in the hepfile and found these

under 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 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!

Share this post


Link to post
Share on other sites
lopolop

ok i think it returns that when there are no solutions.

Thanks!


Share this post


Link to post
Share on other sites
MSLx Fanboy

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 :lmao:

Edited by MSLx Fanboy

Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×