From ff2bb51855e5a0d91d4e69f8a889229b2535b1ef Mon Sep 17 00:00:00 2001 From: Robert Eisele Date: Sun, 6 Sep 2015 12:38:00 +0200 Subject: [PATCH] Implemented lcm for fractions --- lib/function/arithmetic/lcm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/function/arithmetic/lcm.js b/lib/function/arithmetic/lcm.js index f51a4b384..874a48226 100644 --- a/lib/function/arithmetic/lcm.js +++ b/lib/function/arithmetic/lcm.js @@ -46,7 +46,9 @@ function factory (type, config, load, typed) { 'BigNumber, BigNumber': _lcmBigNumber, - // TODO: implement support for Fraction + 'Fraction, Fraction': function (x, y) { + return x.mul(y).abs().div(x.gcd(y)); + }, 'Matrix, Matrix': function (x, y) { // result