summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-07-28 14:50:17 -0700
committerRuss Cox <rsc@golang.org>2009-07-28 14:50:17 -0700
commit18ea3d20dd8fbe694c5800d2fc168f75d4ced8d4 (patch)
tree6bb14fa78658753705b7313810828a8801bfe4d1
parent1d9855bd39cd04f70d17aa9bbf57245ef98c9d85 (diff)
downloadgolang-18ea3d20dd8fbe694c5800d2fc168f75d4ced8d4.tar.gz
fmt boundary bugs.
pow10 was giving up too easily. R=r DELTA=4 (0 added, 3 deleted, 1 changed) OCL=32310 CL=32321
-rw-r--r--src/lib9/fmt/fltfmt.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib9/fmt/fltfmt.c b/src/lib9/fmt/fltfmt.c
index 3ce8babb0..628011d6e 100644
--- a/src/lib9/fmt/fltfmt.c
+++ b/src/lib9/fmt/fltfmt.c
@@ -16,10 +16,20 @@
* THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
-#include <u.h>
+/* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */
+#include <stdio.h>
+#include <math.h>
+#include <float.h>
+#include <string.h>
+#include <stdlib.h>
#include <errno.h>
-#include <libc.h>
+#include <stdarg.h>
+#include <fmt.h>
+#include <assert.h>
+#include "plan9.h"
+#include "fmt.h"
#include "fmtdef.h"
+#include "nan.h"
enum
{
@@ -52,8 +62,7 @@ static double pows10[] =
1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159,
};
#define npows10 ((int)(sizeof(pows10)/sizeof(pows10[0])))
-#undef pow10
-#define pow10 fmtpow10
+#define pow10(x) fmtpow10(x)
static double
pow10(int n)