aboutsummaryrefslogtreecommitdiff
path: root/src/formatter.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-03-21 22:03:55 +0000
committerMike Buland <eichlan@xagasoft.com>2011-03-21 22:03:55 +0000
commit9d7ee5a5b9b6ca2093043b7c584df02913739b02 (patch)
treedec9d86baa65cc4cabdc509d590b5689a1ddd9d1 /src/formatter.cpp
parent7d605dda5a653c4c40be6de10853d6945457324a (diff)
downloadlibbu++-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.cpp45
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
13template<> float Bu::tlog( float x )
14{
15 return logf( x );
16}
17
18template<> double Bu::tlog( double x )
19{
20 return log( x );
21}
22
23template<> long double Bu::tlog( long double x )
24{
25 return logl( x );
26}
27
28template<> float Bu::tfloor( float x )
29{
30 return floorf( x );
31}
32
33template<> double Bu::tfloor( double x )
34{
35 return floor( x );
36}
37
38template<> long double Bu::tfloor( long double x )
39{
40 return floorl( x );
41}
42
43template<> float Bu::tpow( float x, float y )
44{
45 return powf( x, y );
46}
47
48template<> double Bu::tpow( double x, double y )
49{
50 return pow( x, y );
51}
52
53template<> long double Bu::tpow( long double x, long double y )
54{
55 return powl( x, y );
56}
57
13Bu::Formatter::Formatter( Stream &rStream ) : 58Bu::Formatter::Formatter( Stream &rStream ) :
14 rStream( rStream ), 59 rStream( rStream ),
15 bTempFmt( false ), 60 bTempFmt( false ),