1. Factoring - Reply
- Posted by "BABOR, JIRI" <J.Babor at GNS.CRI.NZ> Sep 01, 1997
- 593 views
Bryan Watts wrote: > Factoring, for those of you who forget, is where you get a > problem like x=B2 - 4x - 12 and you have to come up with > two things multiplied together that come to that, which is > (x-6)(x+2) for that problem. If you are confused by Daniel's explanation, and if you are interested in second degree polynomials only, the following formula will give you the answers you probably want. Jiri -- snip ------------------------------------------------------ function factors(atom a, atom b, atom c) atom d d=b*b-4*a*c if d<0 then return {{-b,sqrt(-d)},{-b,-sqrt(-d)}}/(2*a) -- complex roots else return {-b+sqrt(d),-b-sqrt(d)}/(2*a) end if end function