Help: Need to solve a SECOND DEGREE equation in VB
Author Message
Help: Need to solve a SECOND DEGREE equation in VB

HI,
I need to solve a second degree equation in Visual Basic....something
like this:
12.32*X^2 + 179.24*X - 958.1625 = 0
and I need the "positive" ( X=4.157 ) solution to be defined in a
variable
Im using Visual Basic 4.
Can anybody help me??

Joao Marques

Tue, 20 Jul 1999 03:00:00 GMT
Help: Need to solve a SECOND DEGREE equation in VB

Quote:

> HI,
> I need to solve a second degree equation in visual basic....something
> like this:
> 12.32*X^2 + 179.24*X - 958.1625 = 0
> and I need the "positive" ( X=4.157 ) solution to be defined in a
> variable
> Im using Visual Basic 4.

How would you solve it if you *didn't* have VB4?

Quote:
> Can anybody help me??

Hmmm. The unmistakable odour of homework, methinks.

Quote:
> Joao Marques

--

Vox (0|+44)1642 216 200  }*|*{  *o|o*  }o|o{ Zetland Buildings, Exchange Square
Fax (0|+44)1642 216 201    o      o      *   Middlesbrough, Cleveland.  TS1 1DE
--------- "Estimate how many people in the UK can make this estimate" ---------

Tue, 20 Jul 1999 03:00:00 GMT
Help: Need to solve a SECOND DEGREE equation in VB

Hello !

Eq :
aX2+bX+c=0
calculate :
d=b2-4*a*c
if d<0, there is no real solution.
if d=0, there is only one solution :
X= -b/(2*a)
if d>0, ther is two real solutions
X1= (-b+sqrt(d))/(2*a)  (sqrt = square root)
X2= (-b-sqrt(d))/(2*a)
Then, you just have to choose the one you want.

bye.
Sylvain.

Quote:
> HI,
> I need to solve a second degree equation in visual basic....something
> like this:
> 12.32*X^2 + 179.24*X - 958.1625 = 0
> and I need the "positive" ( X=4.157 ) solution to be defined in a
> variable
> Im using Visual Basic 4.
> Can anybody help me??

> Joao Marques

Tue, 20 Jul 1999 03:00:00 GMT

 Page 1 of 1 [ 3 post ]

Relevant Pages