Module:Rational: Difference between revisions

Plumtree (talk | contribs)
is_superabundant() implemented
Plumtree (talk | contribs)
m from_continued_fraction() implemented
Line 40: Line 40:
end
end
return b
return b
end
function p.from_continued_fraction(data)
local val = p.new(1, 0)
for i = #data, 1, -1 do
val = p.add(data[i], p.inv(val))
end
return val
end
end