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

nicolewhite / algebra.js / 53 / 1
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 12 Aug 2015 02:41PM UTC
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

12 Aug 2015 02:38PM UTC coverage: 96.913% (+0.1%) from 96.81%
53.1

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

Source Files on job 53.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 53
  • Travis Job 53.1
  • 11441d11 on github
  • Prev Job for on master (#52.1)
  • Next Job for on master (#54.1)
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