jle_cpp_tk  0.0 2015-04-03 sh1:"d699093732dd5f321606d0ff7a6b63b229f1922c"
A small, safe, selft contained, soft-realtime C++ toolkit
dbl.h
1 #ifndef JLE_DBL_H__
2 #define JLE_DBL_H__
3 
4 #include <iosfwd>
5 
6 
7 
14 namespace jle {
15 
16 
17 
18 class dbl {
19 
20  public:
21  dbl () = delete;
22  dbl (const dbl&) = default;
23  dbl (dbl&&) = default;
24  dbl& operator= (const dbl&) = default;
25  dbl& operator= (dbl&&) = default;
26 
30  dbl(double v) : value(v){}; /*removed explicit explicit*/
31 
33  explicit operator double() const { return value; };
34 
35 
36  private:
37  double value;
38 };
39 
40 
42 dbl pow (const dbl& base, const dbl& exp );
43 
45 dbl log (const dbl& d );
46 
48 dbl exp (const dbl& d );
49 
55 int get_decimals10(const dbl& d);
56 
57 std::ostream& operator<< (std::ostream& os, const dbl& d);
58 
59 dbl operator+ (const dbl& d1, const dbl& d2);
60 dbl operator- (const dbl& d1, const dbl& d2);
61 dbl operator* (const dbl& d1, const dbl& d2);
62 dbl operator/ (const dbl& d1, const dbl& d2);
63 
64 dbl& operator+= (dbl& d1, const dbl& d2);
65 dbl& operator-= (dbl& d1, const dbl& d2);
66 dbl& operator*= (dbl& d1, const dbl& d2);
67 dbl& operator/= (dbl& d1, const dbl& d2);
68 
69 
70 bool operator == (const dbl& d1, const dbl& d2);
71 bool operator != (const dbl& d1, const dbl& d2);
72 bool operator < (const dbl& d1, const dbl& d2);
73 bool operator <= (const dbl& d1, const dbl& d2);
74 bool operator > (const dbl& d1, const dbl& d2);
75 bool operator >= (const dbl& d1, const dbl& d2);
76 
77 
78 //---------------------------------------------------------------------------
79 }; //namespace jle {
80 
81 
82 
83 
84 #endif // JLE_DBL_H__
Definition: dbl.h:18
dbl exp(const dbl &d)
as double version std::
Definition: dbl.cpp:22
int get_decimals10(const dbl &d)
Get number of decimals base 10 (aprox)
Definition: dbl.cpp:28
dbl log(const dbl &d)
as double version std::
Definition: dbl.cpp:16
dbl(double v)
Definition: dbl.h:30
dbl pow(const dbl &base, const dbl &exp)
as double version std::
Definition: dbl.cpp:10
generic namespace
Definition: alarm.cpp:12