[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2007-01-27T12:47:16-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/2284 2007-01-27T12:47:16-05:00 2007-01-27T12:47:16-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=14137#p14137 <![CDATA[x + x^2=90]]>

Code:

PosX=(-B+SQR((B^2)-(4*A*C)))/(2*A)NegX=(-B-SQR((B^2)-(4*A*C)))/(2*A)
as the quadratic formula has a plus and minus. However, if the discriminant (B^2-4AC) is negative, QB will generate an error because it has an imaginary solution.

Statistics: Posted by Patz QuickBASIC Creations — Sat Jan 27, 2007 12:47 pm


]]>
2007-01-25T20:05:58-05:00 2007-01-25T20:05:58-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=14133#p14133 <![CDATA[x + x^2=90]]>
Yoo could use the brute force approach by writing a little program that uses a FOR loop on X, and keeps testing until it finds it. Something like this:
[code}
FOR X = 1 TO 90
T = X + X^2
IF T = 90 THEN PRINT "ANSWER = ";X : GOTIT=1 :EXIT FOR
NEXT X
IF GOTIT=0 THEN PRINT "NOT FOUND, X MUST BE FRACTIONAL"
[/code]

PS, I haven't tried it.

Regards..... Moneo

Statistics: Posted by moneo — Thu Jan 25, 2007 8:05 pm


]]>
2007-01-25T17:50:52-05:00 2007-01-25T17:50:52-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=14132#p14132 <![CDATA[Re: x + x^2=90]]>
I know that in this case, x is equal to 9, but how would I figure this out mathematically?
Looks like you have a quadratic equation thingy.

x^2 + x - 90 = 0

Image

though that could be optimized a bit because 'a' and 'b' would be ones.

Statistics: Posted by seaBiscuit$ — Thu Jan 25, 2007 5:50 pm


]]>
2007-01-25T17:16:43-05:00 2007-01-25T17:16:43-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=14131#p14131 <![CDATA[x + x^2=90]]> Statistics: Posted by {Nathan} — Thu Jan 25, 2007 5:16 pm


]]>