#include <FWMath.h>
This class contains all kind of mathematical support functions
Static Public Member Functions | |
| static double | mod (double dividend, double divisor) |
| static double | div (double dividend, double divisor) |
| static bool | close (double one, double two) |
| static int | stepfunction (double i) |
| static int | sign (double i) |
| static int | round (double d) |
| static double | max (double a, double b) |
| static double | dBm2mW (double dBm) |
|
||||||||||||
|
Tests whether two doubles are close enough to be declared equal.
00079 {
00080 return fabs(one-two)<EPSILON;
00081 }
|
|
|
convert a dBm value into milli Watt 00108 {
00109 return pow(10.0, dBm/10.0);
00110 }
|
|
||||||||||||
|
Returns the result of a whole-numbered division. 00067 {
00068 double i;
00069 double f;
00070 f=modf(dividend/divisor, &i);
00071 return i;
00072 }
|
|
||||||||||||
|
00103 { return (a<b)? b : a; }
|
|
||||||||||||
|
Returns the rest of a whole-numbered division. 00059 {
00060 double i;
00061 return modf(dividend/divisor, &i)*divisor;
00062 }
|
|
|
00098 { return (int)(ceil(d-0.5)); }
|
|
|
00093 { return (i>=0)? 1 : -1; };
|
|
|
00087 { return (i>EPSILON) ? 1 : close(i,0) ? 0 :-1; };
|
1.4.1