fix ldexp, frexp, and make math package compile and test correctly

SVN=126423
This commit is contained in:
Rob Pike 2008-07-08 17:26:10 -07:00
parent 4528854308
commit 41b9617be4
9 changed files with 213 additions and 214 deletions

View file

@ -358,7 +358,7 @@ func unpack(a double) (negative bool, exp int, num double) {
}
// find g,e such that a = g*10^e.
// guess 10-exponent using 2-exponent, then fine tune.
e2, g := sys.frexp(a);
g, e2 := sys.frexp(a);
e := int(e2 * .301029995663981);
g = a * pow10(-e);
for g < 1 {