Roots of a quadratic function: Difference between revisions

m
Line 1,846:
qroots(1, -1e9, 1)
[1] 1e+09+0i 1e-09+0i</lang>
 
Using the builtin '''polyroot''' function (note the order of coefficients is reversed):
 
<lang R>polyroot(c(-2i, 0, 1))
[1] 1+1i -1-1i
 
polyroot(c(1, -1e9, 1))
[1] 1e-09+0i 1e+09+0i</lang>
 
=={{header|Racket}}==
1,336

edits