Anonymous user
Roots of a quadratic function: Difference between revisions
m
→version 1: used nine digits precision for the output, simplified the code, use a template for the output sections, added/changed whitespace and comments.
(Added Wren) |
m (→version 1: used nine digits precision for the output, simplified the code, use a template for the output sections, added/changed whitespace and comments.) |
||
Line 1,877:
<br>(from a default of '''9''') to '''200''' to accommodate when a root is closer to zero than the other root.
Note that only
This REXX version supports ''complex numbers'' for the result.
<lang rexx></lang>
▲'''output''' when using the input of: <tt> 1 -10e5 1 </tt>
<pre>
a = 1
Line 1,917 ⟶ 1,890:
root2 = 0.000001
</pre>
The following output is when Regina 3.9.
<pre>
a = 1
b = -
c = 1
Line 1,930 ⟶ 1,903:
The following output is when R4 REXX is used.
<pre>
a = 1
Line 1,939 ⟶ 1,912:
root2 = 0.0000000001
</pre>
<pre>
a = 3
Line 1,945 ⟶ 1,918:
c = 1
root1 = -0.
root2 = -0.
</pre>
<pre>
a = 1
|