Project: Cubic Roots (Command Line)
Cubic equations of the form Ax3 + Bx2 + Cx + D = 0 have three possible solutions given by the [[Cubic Formula]]. Write a program that accepts the four constants on the command line then prints the three possible solutions.
See: CubicRoots
Output
$ node CubicRootsCmdLine.js 1 -6 11 -6
root #1: 3
root #2: 2
root #3: 0.9999999999999998
$ node CubicRootsCmdLine.js 1 -2.2 -6.05 7.986
root #1: 3.3
root #2: 1.1000000000000005
root #3: -2.1999999999999997