4,951
edits
m (Formatting) |
Falterfire (talk | contribs) (added p.fractionpair) |
||
Line 292: | Line 292: | ||
local gcd = p.gcd(n, d) | local gcd = p.gcd(n, d) | ||
return p.formatnum(n/gcd)..'/'..p.formatnum(d/gcd) | return p.formatnum(n/gcd)..'/'..p.formatnum(d/gcd) | ||
end | |||
--Similar to p.fraction but returns the simplified numerator and denomerator separately without formatting | |||
function p.fractionpair(n, d) | |||
local gcd = p.gcd(n, d) | |||
return n / gcd, d / gcd | |||
end | end | ||