(a, b)
| 194 | } |
| 195 | |
| 196 | function leastCommonMultiple(a, b) { |
| 197 | if(a < 1 || b < 1) return undefined; |
| 198 | var A = getFactors(a); |
| 199 | var B = getFactors(b); |
| 200 | var n = 1; |
| 201 | for(var i = 0; i < shortPrimes.length; i++) { |
| 202 | n *= Math.pow( |
| 203 | shortPrimes[i], Math.max(A[i], B[i]) |
| 204 | ); |
| 205 | } |
| 206 | return n; |
| 207 | } |
| 208 | |
| 209 | function arrayLCM(A) { |
| 210 | if(A.length === 0) return undefined; |
no test coverage detected
searching dependent graphs…