Sat, 21 Sep 2013 14:31:22 +0100
Fix math.frexp() and add more tests (thanks Florob, Link Mauve, xnyhps)
local m, e = math.frexp(1); assert(m == 0.5 and e == 1, "frexp(1)"); local m, e = math.frexp(0); assert(m == 0 and e == 0, "frexp(0)"); local m, e = math.frexp(3); assert(m == 0.75 and e == 2, "frexp(3)"); local m, e = math.frexp(-1); assert(m == -0.5 and e == 1, "frexp(-1)"); local m, e = math.frexp(0.5); assert(m == 0.5 and e == 0, "frexp(0.5)"); local m, e = math.frexp(0.1); assert(m == 0.8 and e == -3, "frexp(0.1)");