Glen Whitney
880efac15b
And add an 'associate' predicate for two complex numbers to check the results
11 lines
264 B
JavaScript
11 lines
264 B
JavaScript
import {reducingOperation} from './reducingOperation.mjs'
|
|
|
|
export const lcm = {
|
|
'T,T': ({
|
|
'multiply(T,T)': multT,
|
|
'quotient(T,T)': quotT,
|
|
'gcd(T,T)': gcdT
|
|
}) => (a,b) => multT(quotT(a, gcdT(a,b)), b)
|
|
}
|
|
Object.assign(lcm, reducingOperation)
|