Module:Rational: Difference between revisions

Plumtree (talk | contribs)
mNo edit summary
Plumtree (talk | contribs)
mNo edit summary
Line 65: Line 65:
return { zero = true, sign = a.sign * b.sign }
return { zero = true, sign = a.sign * b.sign }
end
end
-- the regular case: both not NaN, not infinities, not zeros
-- regular case: both not NaN, not infinities, not zeros
local c = p.copy(a)
local c = p.copy(a)
for factor, power in pairs(b) do
for factor, power in pairs(b) do
Line 97: Line 97:
return { inf = true, sign = a.sign }
return { inf = true, sign = a.sign }
end
end
-- the regular case: not NaN, not infinity, not zero
-- regular case: not NaN, not infinity, not zero
b = {}
b = {}
for factor, power in pairs(a) do
for factor, power in pairs(a) do