• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nicolewhite / algebra.js / 53
95%

Build:
DEFAULT BRANCH: master
Ran 12 Aug 2015 02:41PM UTC
Jobs 1
Files 5
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
53

push

travis-ci

nicolewhite
Solve cubics when the discriminant > 0

When the discriminant of a cubic equation is greater than 0, there are
three distinct real roots and we encounter the problem Cardano and crew
called Casus Irreducibilis. If you attempt to solve in algebra land,
you have to temporarily traverse the complex number space to arrive at
your real numbered solution. But we can avoid this by going over into
trigonometry land. As of now, Fraction objects are only returned when
the answers are integers. Returning non-integer rationals is on the
TODO list.

var n1 = new Expression("x").add(2); // x + 2
var n2 = new Expression("x").add(3); // x + 3
var n3 = new Expression("x").add(4); // x + 4

var cubic = n1.multiply(n2).multiply(n3);
cubic = new Equation(cubic, 0);
var answers = cubic.solveFor("x");
console.log(answers.toString()); // -4,-3,-2

722 of 745 relevant lines covered (96.91%)

255.95 hits per line

Jobs
ID Job ID Ran Files Coverage
1 53.1 12 Aug 2015 02:41PM UTC 0
96.91
Travis Job 53.1
Source Files on build 53
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #53
  • 11441d11 on github
  • Prev Build on master (#52)
  • Next Build on master (#54)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc