diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-19 14:24:27 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-05-19 14:24:27 +0000 |
commit | 162e60d66c78bd51aa44c691fe4f4e2f1deb990f (patch) | |
tree | 789cf10a148bf3912579e18393604e268ff9934c /plugins/Quotes/IsWithinAccuracy.h | |
parent | 6a22ccd156510e65fb91f45a81a9e87d5ad07568 (diff) |
added Quotes
git-svn-id: http://svn.miranda-ng.org/main/trunk@76 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Quotes/IsWithinAccuracy.h')
-rw-r--r-- | plugins/Quotes/IsWithinAccuracy.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Quotes/IsWithinAccuracy.h b/plugins/Quotes/IsWithinAccuracy.h new file mode 100644 index 0000000000..708c101a27 --- /dev/null +++ b/plugins/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__
|