Anonymous user
Talk:Roots of a quadratic function: Difference between revisions
Talk:Roots of a quadratic function (view source)
Revision as of 09:16, 13 November 2020
, 3 years ago→obscure algorithm ?: added a reference to show how different computer programming languages deal with infix operators with exponentiation.
No edit summary |
(→obscure algorithm ?: added a reference to show how different computer programming languages deal with infix operators with exponentiation.) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1:
== obscure algorithm ? ==
I don't like being pushed to use obscure (but more stable) algorhithm over algorithm everyone instantly recognises.▼
▲I don't like being pushed to use obscure (but more stable)
Said that, I could live with it. But I want to point that:
* - link for "What Every Scientist Should Know About Floating-Point Arithmetic" is dead;
* - one can google for it, but formatting is different, so how to find what "page 9" actually is?
* - quoted in the text, "Suggested by Middlebrook (D-OA), a better numerical method: to define two parameters q=sqr(ac)/b (...)" naturally fails over if a>0 and c<0.
"do it better" ?
I clearly see <strike>come</strike> some of programs (Ada, and some marked as "translation of Ada") use
(b^2-4ac)/2*a,
there correct way is
Line 12 ⟶ 14:
I wonder why noone spotted this earlier!
<cite>Forsythe, Michael Malcolm and Cleve
Basically all the test cases had a = 1, :-) So I added some test cases especially where a ≠ 1, hence 2*a ≠ 2/a.... [[User:NevilleDNZ|NevilleDNZ]] 14:28, 16 September 2010 (UTC)
: In the example above (2nd line) (-10<sup>6</sup>) isn't the same as -1e6. The former is -1,000,000 and the latter is +1,000,000. --[[User:Gerard Schildberger|Gerard Schildberger]] 18:11, 25 June 2011 (UTC)
:: Other way round surely
::: Nope. -1e6 = -1000000. And -10^6=-1000000 as well, except in some insane languages. [[User:Eoraptor|Eoraptor]] ([[User talk:Eoraptor|talk]]) 17:35, 13 August 2020 (UTC)
:::: It all depends if the infix (negative) operator has more or less priority then the exponent operator. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 09:14, 13 November 2020 (UTC)
:::: See: [[Exponentiation with infix operators in (or operating on) the base]].
== J example ==
Dumontier, hope you don't mind me replacing your example code. I understood that you were trying to illustrate the generality of <code>p.</code> however your example used a quadratic, that had already been shown above. If you were trying to illustrate some other point I apologise! --[[User:Tikkanz|Tikkanz]] 23:14, 14 October 2009 (UTC)
== C examples ==
Line 30 ⟶ 39:
Eh never mind that, and sorry about making a mess on the incorrect tags--I need sleep... --[[User:Ledrug|Ledrug]] 09:40, 25 June 2011 (UTC)
== Clojure example ==
|