Flat-schmat! [was Re: Python syntax in Lisp and Scheme]

Robin Becker robin at jessikat.fsnet.co.uk
Sat Oct 4 19:41:06 EDT 2003


In article <PsIfb.2222$gA1.1619 at newsread3.news.pas.earthlink.net>,
Andrew Dalke <adalke at mindspring.com> writes
......
>Since the quadratic formula yields two results, I expect most
>people write it more like
>
>droot = sqrt(b*b-4*a*c)  # square root of the discriminate
>x_plus   = (-b + droot) / (4*a*c)
>x_minus = (-b - droot) / (4*a*c)
>
>possibly using a temp variable for the 4*a*c term, for a
>slight bit better performance.

perhaps we should be using computer algebra as suggested in this paper
http://www.mmrc.iss.ac.cn/~ascm/ascm03/sample.pdf on computing the
solutions of quadratics.
-- 
Robin Becker




More information about the Python-list mailing list