Re: A82: ASM Math program that needs to be written!
[Prev][Next][Index][Thread]
Re: A82: ASM Math program that needs to be written!
At 08:27 AM 9/7/97 -0600, you wrote:
>Now every one knows that the quadratic equ., foiling, and factoring is a
>big part of high-school math and also on the psat, sat etc..Most people
>have a good quadratic equation and foiling program that runs fairly fast
>on there 82. But a DE-foiling or factoring program is needed badly,
>especially one that works fast. So I made a basic program which goes
>through lots of number combinations until it finds the right one (all
>combinations between -8 and 8 NOTE:ASM version should go through -20 to
>20) But this program takes 30 minutes or more to find the answer so it
>is useless
> -TIA Ilya W.
We'll after seeing this, I remebered my days of algebra, and the quadratic
formula. If you use the quadratic, it will give you the two factors of the
equation. It's that simple! Here's my program which will give you the two
factors of a given quadratic:
\START82\
\COMMENT="DEFACTOR" By Ben Bardill 9/8/97
\NAME=DEFACTOR
\FILE=C:\BEN\TI\DEFACTOR.82P
:ClrHome
:Disp "aX\^2\+bX+c
:Prompt A,B,C
:If B\^2\-4AC<0:Then
:Disp "IMAGINARY
:Stop:End
:(B+\sqrt\(B\^2\-4AC))/2A\->\X
:fPart X\->\Q
:Disp "
:Disp "( X + )\^2\
:If Q=0:Then
:Output(6,2,"1
:Output(6,10,X
:Stop
:Else
:Output(6,2,Q\^-1\
:Output(6,10,Q\^-1\X
:End
\STOP82\
I hope this helps anyone who uses it, it sure is a hell of a lot quicker
than FOR loops!
Osprey-Ben