summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-08-09 16:55:56 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-08-09 16:55:56 +0000
commitff2fac11a03b7e13149b5069fda2bbc21cdd4e80 (patch)
treec7c6acd177623990d573293590f57b74fd470665 /libs/pbd
parent3d07cbc37ffe9768f3cf568531cb38b5bf5a3fce (diff)
more vst parameter related stuff
git-svn-id: svn://localhost/ardour2/branches/3.0@13119 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/floating.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/pbd/pbd/floating.h b/libs/pbd/pbd/floating.h
index f707dc9f5b..ef97ce8fcc 100644
--- a/libs/pbd/pbd/floating.h
+++ b/libs/pbd/pbd/floating.h
@@ -7,6 +7,8 @@
#ifndef __libpbd__floating_h__
#define __libpbd__floating_h__
+#include <cmath>
+
namespace PBD {
union Float_t
@@ -26,18 +28,18 @@ union Float_t
static inline bool floateq (float a, float b, int max_ulps_diff)
{
- Float_t ua(a);
- Float_t ub(b);
+ Float_t ua (a);
+ Float_t ub (b);
+ if (a == b) {
+ return true;
+ }
+
// Different signs means they do not match.
if (ua.negative() != ub.negative()) {
- // Check for equality to make sure +0==-0
- if (a == b) {
- return true;
- }
return false;
}
-
+
// Find the difference in ULPs.
int ulps_diff = abs (ua.i - ub.i);