Module:Rational: Difference between revisions

Sorting functions
Since a cent is just a scaled octave, the two functions should behave the same
Line 930: Line 930:
a = p.new(a)
a = p.new(a)
end
end
if a.nan or a.inf or a.zero or a.sign < 0 then
if a.nan or a.inf or a.sign < 0 then
return nil
return nil
end
end
if a.inf and a.sign > 0 then
return 1/0
end
if a.zero then
return -1/0
end
local c = 0
local c = 0
for factor, power in pairs(a) do
for factor, power in pairs(a) do