diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-06-15 15:45:27 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-06-15 15:45:27 -0700 |
commit | ccca4d71360776f5589312525b2397c84ad0096d (patch) | |
tree | e39eb15bfcbaf5da7ba0473367ea3a6e4215861f | |
parent | 5ec762a6006959a9ef37b4e7855702d621481b2f (diff) |
Acknowledge authorship and fix warning in the eng() function.
-rw-r--r-- | test_util.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test_util.h b/test_util.h index 6e9e7f9..a998a19 100644 --- a/test_util.h +++ b/test_util.h @@ -1,3 +1,6 @@ +/* Function for printing numbers using si prefixes (k, M, G, etc.). + * From http://www.cs.tut.fi/~jkorpela/c/eng.html */ + #define PREFIX_START (-24) /* Smallest power of then for which there is a prefix defined. If the set of prefixes will be extended, change this constant @@ -8,7 +11,7 @@ static char *eng(double value, int digits, int numeric) { - static char *prefix[] = { + static const char *prefix[] = { "y", "z", "a", "f", "p", "n", "u", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" }; |