Last change
on this file since 93 was 89, checked in by morasjul, 12 years ago |
PACPUS 2.0 Beta deployed in new branch
Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support
|
-
Property svn:executable
set to
*
|
File size:
517 bytes
|
Line | |
---|
1 | #ifndef __HELPER_H__
|
---|
2 | #define __HELPER_H__
|
---|
3 |
|
---|
4 | #include <math.h>
|
---|
5 | #include <float.h>
|
---|
6 | #include <vector>
|
---|
7 | #include <algorithm>
|
---|
8 |
|
---|
9 | namespace
|
---|
10 | {
|
---|
11 | inline double Min_(double a, double b)
|
---|
12 | {
|
---|
13 | return (a<b) ? a : b;
|
---|
14 | }
|
---|
15 | }
|
---|
16 |
|
---|
17 | namespace Qwt3D
|
---|
18 | {
|
---|
19 |
|
---|
20 | inline bool isPracticallyZero(double a, double b = 0)
|
---|
21 | {
|
---|
22 | if (!b)
|
---|
23 | return (fabs (a) <= DBL_MIN);
|
---|
24 |
|
---|
25 | return (fabs (a - b) <= Min_(fabs(a), fabs(b))*DBL_EPSILON);
|
---|
26 | }
|
---|
27 |
|
---|
28 | inline int round(double d)
|
---|
29 | {
|
---|
30 | return (d>0) ? int(d+0.5) : int(d-0.5);
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | } //ns
|
---|
35 |
|
---|
36 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.