converted double to float64

SVN=126446
diff --git a/src/lib/math/asin.go b/src/lib/math/asin.go
index a0135f4..f7a286b 100644
--- a/src/lib/math/asin.go
+++ b/src/lib/math/asin.go
@@ -18,13 +18,13 @@
 
 const
 (
-	pio2	= .15707963267948966192313216e1;
+	pio2 = .15707963267948966192313216e1
 )
 
 func
-asin(arg double)double
+asin(arg float64)float64
 {
-	var temp, x double;
+	var temp, x float64;
 	var sign bool;
 
 	sign = false;
@@ -51,7 +51,7 @@
 }
 
 func
-acos(arg double)double
+acos(arg float64)float64
 {
 	if(arg > 1 || arg < -1) {
 		return sys.NaN();
diff --git a/src/lib/math/atan.go b/src/lib/math/atan.go
index 064b8d4..0c284b8 100644
--- a/src/lib/math/atan.go
+++ b/src/lib/math/atan.go
@@ -7,12 +7,12 @@
 export	atan
 
 /*
-	floating-point arctangent
-
-	atan returns the value of the arctangent of its
-	argument in the range [-pi/2,pi/2].
-	there are no error returns.
-	coefficients are #5077 from Hart & Cheney. (19.56D)
+ *	floating-point arctangent
+ *
+ *	atan returns the value of the arctangent of its
+ *	argument in the range [-pi/2,pi/2].
+ *	there are no error returns.
+ *	coefficients are #5077 from Hart & Cheney. (19.56D)
 */
 
 
@@ -35,14 +35,14 @@
 )
 
 /*
-	xatan evaluates a series valid in the
-	range [-0.414...,+0.414...]. (tan(pi/8))
+ *	xatan evaluates a series valid in the
+ *	range [-0.414...,+0.414...]. (tan(pi/8))
  */
 
 func
-xatan(arg double) double
+xatan(arg float64) float64
 {
-	var argsq, value double;
+	var argsq, value float64;
 
 	argsq = arg*arg;
 	value = ((((p4*argsq + p3)*argsq + p2)*argsq + p1)*argsq + p0);
@@ -51,12 +51,11 @@
 }
 
 /*
-	satan reduces its argument (known to be positive)
-	to the range [0,0.414...] and calls xatan.
+ *	satan reduces its argument (known to be positive)
+ *	to the range [0,0.414...] and calls xatan.
  */
-
 func
-satan(arg double) double
+satan(arg float64) float64
 {
 
 	if arg < sq2m1 {
@@ -69,12 +68,11 @@
 }
 
 /*
-	atan makes its argument positive and
-	calls the inner routine satan.
+ *	atan makes its argument positive and
+ *	calls the inner routine satan.
  */
-
 func
-atan(arg double) double
+atan(arg float64) float64
 {
 
 	if arg > 0 {
diff --git a/src/lib/math/atan2.go b/src/lib/math/atan2.go
index b3bddf7..c002c83 100644
--- a/src/lib/math/atan2.go
+++ b/src/lib/math/atan2.go
@@ -8,9 +8,9 @@
 export	atan2
 
 /*
-	atan2 discovers what quadrant the angle
-	is in and calls atan.
-*/
+ *	atan2 discovers what quadrant the angle
+ *	is in and calls atan.
+ */
 
 const
 (
@@ -19,9 +19,9 @@
 )
 
 func
-atan2(arg1, arg2 double) double
+atan2(arg1, arg2 float64) float64
 {
-	var x double;
+	var x float64;
 
 	if arg1+arg2 == arg1 {
 		if arg1 >= 0 {
diff --git a/src/lib/math/exp.go b/src/lib/math/exp.go
index dc851a0..cce9386 100644
--- a/src/lib/math/exp.go
+++ b/src/lib/math/exp.go
@@ -8,11 +8,11 @@
 export	exp
 
 /*
-	exp returns the exponential func of its
-	floating-point argument.
-
-	The coefficients are #1069 from Hart and Cheney. (22.35D)
-*/
+ *	exp returns the exponential func of its
+ *	floating-point argument.
+ *
+ *	The coefficients are #1069 from Hart and Cheney. (22.35D)
+ */
 
 const
 (
@@ -28,16 +28,16 @@
 )
 
 func
-exp(arg double) double
+exp(arg float64) float64
 {
-	var x, fract, temp1, temp2, xsq double;
+	var x, fract, temp1, temp2, xsq float64;
 	var ent int;
 
 	if arg == 0. {
 		return 1;
 	}
 	if arg < -maxf {
-		return 0.;
+		return 0;
 	}
 	if arg > maxf {
 		return sys.Inf(1)
@@ -45,7 +45,7 @@
 
 	x = arg*log2e;
 	ent = int(floor(x));
-	fract = (x-double(ent)) - 0.5;
+	fract = (x-float64(ent)) - 0.5;
 	xsq = fract*fract;
 	temp1 = ((p2*xsq+p1)*xsq+p0)*fract;
 	temp2 = ((xsq+q2)*xsq+q1)*xsq + q0;
diff --git a/src/lib/math/fabs.go b/src/lib/math/fabs.go
index 4a184be..23ea55b 100644
--- a/src/lib/math/fabs.go
+++ b/src/lib/math/fabs.go
@@ -7,7 +7,7 @@
 export	fabs
 
 func
-fabs(arg double) double
+fabs(arg float64) float64
 {
 
 	if arg < 0 {
diff --git a/src/lib/math/floor.go b/src/lib/math/floor.go
index 108b403..750310e 100644
--- a/src/lib/math/floor.go
+++ b/src/lib/math/floor.go
@@ -12,9 +12,9 @@
  */
 
 func
-floor(arg double) double
+floor(arg float64) float64
 {
-	var fract, d double;
+	var fract, d float64;
 
 	d = arg;
 	if d < 0 {
@@ -30,7 +30,7 @@
 }
 
 func
-ceil(arg double) double
+ceil(arg float64) float64
 {
 	return -floor(-arg);
 }
diff --git a/src/lib/math/fmod.go b/src/lib/math/fmod.go
index 65222ac..b7dd90e 100644
--- a/src/lib/math/fmod.go
+++ b/src/lib/math/fmod.go
@@ -7,14 +7,14 @@
 export	fmod
 
 /*
-	floating-point mod func without infinity or NaN checking
+ *	floating-point mod func without infinity or NaN checking
  */
 
 func
-fmod(x, y double) double
+fmod(x, y float64) float64
 {
 	var yexp, rexp int;
-	var r, yfr, rfr double;
+	var r, yfr, rfr float64;
 	var sign bool;
 
 	if y == 0 {
diff --git a/src/lib/math/hypot.go b/src/lib/math/hypot.go
index 51e6662..2c7e9c5 100644
--- a/src/lib/math/hypot.go
+++ b/src/lib/math/hypot.go
@@ -7,17 +7,17 @@
 export	hypot
 
 /*
-	hypot -- sqrt(p*p + q*q), but overflows only if the result does.
-	See Cleve Moler and Donald Morrison,
-	Replacing Square Roots by Pythagorean Sums
-	IBM Journal of Research and Development,
-	Vol. 27, Number 6, pp. 577-581, Nov. 1983
+ *	hypot -- sqrt(p*p + q*q), but overflows only if the result does.
+ *	See Cleve Moler and Donald Morrison,
+ *	Replacing Square Roots by Pythagorean Sums
+ *	IBM Journal of Research and Development,
+ *	Vol. 27, Number 6, pp. 577-581, Nov. 1983
  */
 
 func
-hypot(p, q double) double
+hypot(p, q float64) float64
 {
-	var r, s, pfac double;
+	var r, s, pfac float64;
 
 	if p < 0 {
 		p = -p;
@@ -40,7 +40,7 @@
 	q = q/p;
 	r = q;
 	p = 1;
-	for ;; {
+	for {
 		r = r*r;
 		s = r+4;
 		if s == 4 {
diff --git a/src/lib/math/log.go b/src/lib/math/log.go
index 96b3d9695..927a7ac 100644
--- a/src/lib/math/log.go
+++ b/src/lib/math/log.go
@@ -7,13 +7,13 @@
 export	log, log10
 
 /*
-	log returns the natural logarithm of its floating
-	point argument.
-
-	The coefficients are #2705 from Hart & Cheney. (19.38D)
-
-	It calls frexp.
-*/
+ *	log returns the natural logarithm of its floating
+ *	point argument.
+ *
+ *	The coefficients are #2705 from Hart & Cheney. (19.38D)
+ *
+ *	It calls frexp.
+ */
 
 const
 (
@@ -30,9 +30,9 @@
 )
 
 func
-log(arg double) double
+log(arg float64) float64
 {
-	var x, z, zsq, temp double;
+	var x, z, zsq, temp float64;
 	var exp int;
 
 	if arg <= 0 {
@@ -54,12 +54,12 @@
 
 	temp = ((p3*zsq + p2)*zsq + p1)*zsq + p0;
 	temp = temp/(((zsq + q2)*zsq + q1)*zsq + q0);
-	temp = temp*z + double(exp)*log2;
+	temp = temp*z + float64(exp)*log2;
 	return temp;
 }
 
 func
-log10(arg double) double
+log10(arg float64) float64
 {
 
 	if arg <= 0 {
diff --git a/src/lib/math/main.go b/src/lib/math/main.go
index 0006151..7b266d8 100644
--- a/src/lib/math/main.go
+++ b/src/lib/math/main.go
@@ -6,7 +6,7 @@
 package main
 
 //import math "math"
-//////////////////
+
  import math "asin"
  import math "atan"
  import math "atan2"
@@ -25,29 +25,26 @@
  import math "tanh"
 
 
-const
-(
-	length	= 10;
-)
+const	length	= 10;
 
 var
 (
-	vf	[length]double;
-	asin	[length]double;
-	atan	[length]double;
-	exp	[length]double;
-	floor	[length]double;
-	log	[length]double;
-	pow	[length]double;
-	sin	[length]double;
-	sinh	[length]double;
-	sqrt	[length]double;
-	tan	[length]double;
-	tanh	[length]double;
+	vf	[length]float64;
+	asin	[length]float64;
+	atan	[length]float64;
+	exp	[length]float64;
+	floor	[length]float64;
+	log	[length]float64;
+	pow	[length]float64;
+	sin	[length]float64;
+	sinh	[length]float64;
+	sqrt	[length]float64;
+	tan	[length]float64;
+	tanh	[length]float64;
 )
 
 func	init();
-func	ck(a,b double);
+func	ck(a,b float64);
 
 func
 main()
@@ -73,7 +70,7 @@
 }
 
 func
-ck(a,b double)
+ck(a,b float64)
 {
 	d := a-b;
 	if d < 0 {
diff --git a/src/lib/math/pow.go b/src/lib/math/pow.go
index 958bb37..2581f8d 100644
--- a/src/lib/math/pow.go
+++ b/src/lib/math/pow.go
@@ -15,9 +15,9 @@
  */
 
 func
-pow(arg1,arg2 double) double
+pow(arg1,arg2 float64) float64
 {
-	var temp double;
+	var temp float64;
 	var l long;
 
 	if arg2 < 0 {
@@ -60,10 +60,10 @@
 		if l&1 != 0 {
 			temp = temp*arg1;
 		}
-		l = l>>1;
+		l >>= 1;
 		if l == 0 {
 			return temp;
 		}
-		arg1 = arg1*arg1;
+		arg1 *= arg1;
 	}
 }
diff --git a/src/lib/math/pow10.go b/src/lib/math/pow10.go
index bb06758..43c23ed 100644
--- a/src/lib/math/pow10.go
+++ b/src/lib/math/pow10.go
@@ -14,15 +14,10 @@
  * the presumption is that GO converts fp numbers better
  * than multipication of lower powers of 10.
  */
-const
-(
-	tabsize		= 70;
-)
 
-var	tab[tabsize] double;
-func	init();
-var	initdone bool;
-
+const	tabsize		= 70;
+var	initdone	bool;
+var	tab[tabsize]	float64;
 //{
 //	1.0e0, 1.0e1, 1.0e2, 1.0e3, 1.0e4, 1.0e5, 1.0e6, 1.0e7, 1.0e8, 1.0e9,
 //	1.0e10,1.0e11,1.0e12,1.0e13,1.0e14,1.0e15,1.0e16,1.0e17,1.0e18,1.0e19,
@@ -33,8 +28,10 @@
 //	1.0e60,1.0e61,1.0e62,1.0e63,1.0e64,1.0e65,1.0e66,1.0e67,1.0e68,1.0e69,
 //};
 
+func	init();
+
 func
-pow10(e int) double 
+pow10(e int) float64 
 {
 	if !initdone {
 		init();
@@ -53,8 +50,11 @@
 init()
 {
 	initdone = true;
-	tab[0] = 1.0;
-	for i:=1; i<tabsize; i=i+1 {
-		tab[i] = tab[i-1]*10;
+
+	tab[0] = 1.0e0;
+	tab[1] = 1.0e1;
+	for i:=2; i<tabsize; i++ {
+		m := i/2;
+		tab[i] = tab[m] * tab[i-m];
 	}
 }
diff --git a/src/lib/math/sin.go b/src/lib/math/sin.go
index dabe825..e1ac553 100644
--- a/src/lib/math/sin.go
+++ b/src/lib/math/sin.go
@@ -21,9 +21,9 @@
 )
 
 func
-sinus(arg double, quad int) double
+sinus(arg float64, quad int) float64
 {
-	var e, f, ysq, x, y, temp1, temp2 double;
+	var e, f, ysq, x, y, temp1, temp2 float64;
 	var k long;
 
 	x = arg;
@@ -34,12 +34,12 @@
 	x = x * piu2;	/* underflow? */
 	if x > 32764 {
 		e,y = sys.modf(x);
-		e = e + double(quad);
+		e = e + float64(quad);
 		temp1,f = sys.modf(0.25*e);
 		quad = int(e - 4*f);
 	} else {
 		k = long(x);
-		y = x - double(k);
+		y = x - float64(k);
 		quad = (quad + int(k)) & 3;
 	}
 
@@ -57,7 +57,7 @@
 }
 
 func
-cos(arg double) double
+cos(arg float64) float64
 {
 	if arg < 0 {
 		arg = -arg;
@@ -66,7 +66,7 @@
 }
 
 func
-sin(arg double) double
+sin(arg float64) float64
 {
 	return sinus(arg, 0);
 }
diff --git a/src/lib/math/sinh.go b/src/lib/math/sinh.go
index a475171..fd3b50a 100644
--- a/src/lib/math/sinh.go
+++ b/src/lib/math/sinh.go
@@ -8,17 +8,17 @@
 export	sinh, cosh
 
 /*
-	sinh(arg) returns the hyperbolic sine of its floating-
-	point argument.
-
-	The exponential func is called for arguments
-	greater in magnitude than 0.5.
-
-	A series is used for arguments smaller in magnitude than 0.5.
-	The coefficients are #2029 from Hart & Cheney. (20.36D)
-
-	cosh(arg) is computed from the exponential func for
-	all arguments.
+ *	sinh(arg) returns the hyperbolic sine of its floating-
+ *	point argument.
+ *
+ *	The exponential func is called for arguments
+ *	greater in magnitude than 0.5.
+ *
+ *	A series is used for arguments smaller in magnitude than 0.5.
+ *	The coefficients are #2029 from Hart & Cheney. (20.36D)
+ *
+ *	cosh(arg) is computed from the exponential func for
+ *	all arguments.
  */
 
 const
@@ -33,9 +33,9 @@
 )
 
 func
-sinh(arg double) double
+sinh(arg float64) float64
 {
-	var temp, argsq double;
+	var temp, argsq float64;
 	var sign bool;
 
 	sign = false;
@@ -43,6 +43,7 @@
 		arg = -arg;
 		sign = true;
 	}
+
 	switch true {
 	case arg > 21:
 		temp = exp(arg)/2;
@@ -63,7 +64,7 @@
 }
 
 func
-cosh(arg double) double
+cosh(arg float64) float64
 {
 	if arg < 0 {
 		arg = - arg;
diff --git a/src/lib/math/sqrt.go b/src/lib/math/sqrt.go
index 4f8a853..6576208 100644
--- a/src/lib/math/sqrt.go
+++ b/src/lib/math/sqrt.go
@@ -7,16 +7,16 @@
 export		sqrt
 
 /*
-	sqrt returns the square root of its floating
-	point argument. Newton's method.
-
-	calls frexp
-*/
+ *	sqrt returns the square root of its floating
+ *	point argument. Newton's method.
+ *
+ *	calls frexp
+ */
 
 func
-sqrt(arg double) double
+sqrt(arg float64) float64
 {
-	var x, temp double;
+	var x, temp float64;
 	var exp, i int;
 
 	if sys.isInf(arg, 1) {
@@ -25,7 +25,7 @@
 
 	if arg <= 0 {
 		if arg < 0 {
-			panic "return sys.NaN()"
+			return sys.NaN();
 		}
 		return 0;
 	}
@@ -43,17 +43,17 @@
 	temp = 0.5 * (1+x);
 
 	for exp > 60 {
-		temp = temp * double(1<<30);
+		temp = temp * float64(1<<30);
 		exp = exp - 60;
 	}
 	for exp < -60 {
-		temp = temp / double(1<<30);
+		temp = temp / float64(1<<30);
 		exp = exp + 60;
 	}
 	if exp >= 0 {
-		temp = temp * double(1 << (exp/2));
+		temp = temp * float64(1 << (exp/2));
 	} else {
-		temp = temp / double(1 << (-exp/2));
+		temp = temp / float64(1 << (-exp/2));
 	}
 
 	for i=0; i<=4; i=i+1 {
diff --git a/src/lib/math/sys.go b/src/lib/math/sys.go
index 41356ce..a24c819 100644
--- a/src/lib/math/sys.go
+++ b/src/lib/math/sys.go
@@ -4,13 +4,13 @@
 
 package sys
 
-func	modf(a double) (x double, y double);
-func	frexp(a double) (e int, m double);
-func	ldexp(f double, e int) double;
+func	modf(a float64) (x float64, y float64);
+func	frexp(a float64) (e int, m float64);
+func	ldexp(f float64, e int) float64;
 
-func	Inf(n int) double;
-func	NaN() double;
-func	isInf(arg double, n int) bool;
+func	Inf(n int) float64;
+func	NaN() float64;
+func	isInf(arg float64, n int) bool;
 
 export	modf, frexp, ldexp
 export	NaN, isInf, Inf
diff --git a/src/lib/math/tan.go b/src/lib/math/tan.go
index 11c0300..6ee6597 100644
--- a/src/lib/math/tan.go
+++ b/src/lib/math/tan.go
@@ -7,8 +7,8 @@
 export		tan
 
 /*
-	floating point tangent
-	Coefficients are #4285 from Hart & Cheney. (19.74D)
+ *	floating point tangent
+ *	Coefficients are #4285 from Hart & Cheney. (19.74D)
  */
 
 const
@@ -25,9 +25,9 @@
 )
 
 func
-tan(arg double) double
+tan(arg float64) float64
 {
-	var temp, e, x, xsq double;
+	var temp, e, x, xsq float64;
 	var i long;
 	var flag, sign bool;
 
diff --git a/src/lib/math/tanh.go b/src/lib/math/tanh.go
index 3e299c8..f857423 100644
--- a/src/lib/math/tanh.go
+++ b/src/lib/math/tanh.go
@@ -8,15 +8,15 @@
 export		tanh
 
 /*
-	tanh(arg) computes the hyperbolic tangent of its floating
-	point argument.
-
-	sinh and cosh are called except for large arguments, which
-	would cause overflow improperly.
+ *	tanh(arg) computes the hyperbolic tangent of its floating
+ *	point argument.
+ *
+ *	sinh and cosh are called except for large arguments, which
+ *	would cause overflow improperly.
  */
 
 func
-tanh(arg double) double
+tanh(arg float64) float64
 {
 	if arg < 0 {
 		arg = -arg;