summaryrefslogtreecommitdiff
path: root/protocols/Quotes/IsWithinAccuracy.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Quotes/IsWithinAccuracy.h')
-rw-r--r--protocols/Quotes/IsWithinAccuracy.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/protocols/Quotes/IsWithinAccuracy.h b/protocols/Quotes/IsWithinAccuracy.h
new file mode 100644
index 0000000000..5e39281719
--- /dev/null
+++ b/protocols/Quotes/IsWithinAccuracy.h
@@ -0,0 +1,15 @@
+#ifndef __C8C6FB80_D66B_4382_8FAB_E92C83F77BB8_IsWithinAcuracy_h__
+#define __C8C6FB80_D66B_4382_8FAB_E92C83F77BB8_IsWithinAcuracy_h__
+
+inline bool IsWithinAccuracy(double dValue1, double dValue2, double dAccuracy = 1e-4)
+{
+ double dDifference = dValue1 - dValue2 ;
+
+ if ((-dAccuracy <= dDifference) && (dDifference <= dAccuracy))
+ return true ;
+ else
+ return false ;
+}
+
+
+#endif //__C8C6FB80_D66B_4382_8FAB_E92C83F77BB8_IsWithinAcuracy_h__