Roots of a function: Difference between revisions

→‎{{header|Tcl}}: balanced angle bracket, added puts call
(→‎{{header|Tcl}}: balanced angle bracket, added puts call)
Line 490:
proc sgn x {expr {($x>0) - ($x<0)}}
 
puts [froots {x {expr {$x**3 - 3*$x**2 + 2*$x}}}]
</lang>
Result and timing:
<pre>/Tcl $ time ./froots.tcl
~0.00000000000 ~1.00000000000 ~2.00000000000
 
Anonymous user