diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-03-21 22:03:55 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-03-21 22:03:55 +0000 |
commit | 9d7ee5a5b9b6ca2093043b7c584df02913739b02 (patch) | |
tree | dec9d86baa65cc4cabdc509d590b5689a1ddd9d1 /src/formatter.cpp | |
parent | 7d605dda5a653c4c40be6de10853d6945457324a (diff) | |
download | libbu++-9d7ee5a5b9b6ca2093043b7c584df02913739b02.tar.gz libbu++-9d7ee5a5b9b6ca2093043b7c584df02913739b02.tar.bz2 libbu++-9d7ee5a5b9b6ca2093043b7c584df02913739b02.tar.xz libbu++-9d7ee5a5b9b6ca2093043b7c584df02913739b02.zip |
floats can be output through the formatter again, except sometimes they're
really ugly.
Diffstat (limited to '')
-rw-r--r-- | src/formatter.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/formatter.cpp b/src/formatter.cpp index dcaa3a5..17fb311 100644 --- a/src/formatter.cpp +++ b/src/formatter.cpp | |||
@@ -10,6 +10,51 @@ | |||
10 | #include "bu/stream.h" | 10 | #include "bu/stream.h" |
11 | #include <string.h> | 11 | #include <string.h> |
12 | 12 | ||
13 | template<> float Bu::tlog( float x ) | ||
14 | { | ||
15 | return logf( x ); | ||
16 | } | ||
17 | |||
18 | template<> double Bu::tlog( double x ) | ||
19 | { | ||
20 | return log( x ); | ||
21 | } | ||
22 | |||
23 | template<> long double Bu::tlog( long double x ) | ||
24 | { | ||
25 | return logl( x ); | ||
26 | } | ||
27 | |||
28 | template<> float Bu::tfloor( float x ) | ||
29 | { | ||
30 | return floorf( x ); | ||
31 | } | ||
32 | |||
33 | template<> double Bu::tfloor( double x ) | ||
34 | { | ||
35 | return floor( x ); | ||
36 | } | ||
37 | |||
38 | template<> long double Bu::tfloor( long double x ) | ||
39 | { | ||
40 | return floorl( x ); | ||
41 | } | ||
42 | |||
43 | template<> float Bu::tpow( float x, float y ) | ||
44 | { | ||
45 | return powf( x, y ); | ||
46 | } | ||
47 | |||
48 | template<> double Bu::tpow( double x, double y ) | ||
49 | { | ||
50 | return pow( x, y ); | ||
51 | } | ||
52 | |||
53 | template<> long double Bu::tpow( long double x, long double y ) | ||
54 | { | ||
55 | return powl( x, y ); | ||
56 | } | ||
57 | |||
13 | Bu::Formatter::Formatter( Stream &rStream ) : | 58 | Bu::Formatter::Formatter( Stream &rStream ) : |
14 | rStream( rStream ), | 59 | rStream( rStream ), |
15 | bTempFmt( false ), | 60 | bTempFmt( false ), |