REM Please feel to use parts of this code in your own programs, REM however please do not modify it and redistribute it. REM If you believe you have made a useful modification to the code REM however, please do email me and tell me at gary.ewer@earthling.net PROC Ratic: LOCAL a,b,c,x,x2 a=3 b=-4 c=-4 gAT 50,30 gFONT 8 gSTYLE 10 gPRINT "Ratic v1.0" gAT 20,62 gSTYLE 0 gPRINT "The Quadratic Equation Solver" gAT 20,80 gPRINT "for the Psion 3a" gAT 60,110 gSTYLE 1 gPRINT "axy + bx + c = 0" gSTYLE 0 gFONT 6 gAT 10,145 gPRINT "¸ Gary Ewer 1998. E-mail " gAT 10,158 gPRINT "or visit my website at http://come.to/prosoft" gFONT 9 gAT 350,90 gPRINT "(Press Esc to Quit)" WHILE 1 dINIT "Enter coefficients" dFLOAT a,"a=",-999999,999999 dFLOAT b,"b=",-999999,999999 dFLOAT c,"c=",-999999,999999 dPOSITION 1,-1 IF DIALOG=0 STOP ENDIF IF a=0 dINIT dTEXT "","Coefficient ""a"" cannot be zero",2 dTEXT "","It's not a quadratic then!",2 dPOSITION 1,-1 IF DIALOG=0 STOP ENDIF ELSEIF (b**2)-(4*a*c)<=-1 dINIT "" dTEXT "","This quadratic equation",2 dTEXT "","has no real roots",2 dPOSITION 1,-1 IF DIALOG=0 STOP ENDIF ELSEIF ((b**2)-(4*a*c))<0 x=(-b)/(2*a) dINIT "Solution" dTEXT "",""+GEN$(x,12)+"",2 dTEXT "","(This is a repeated root)",2 dPOSITION 1,-1 IF DIALOG=0 STOP ENDIF ELSE x=(-b+SQR((b**2)-(4*a*c)))/(2*a) x2=(-b-SQR((b**2)-(4*a*c)))/(2*a) dINIT "Solutions" dTEXT "",""+GEN$(x,12)+"",2 dTEXT "",""+GEN$(x2,12)+"",2 dPOSITION 1,-1 IF DIALOG=0 STOP ENDIF ENDIF ENDWH ENDP