16
|
1 // This file (CustomMath.cs) is a part of the IBBoard library and is copyright 2009 IBBoard.
|
|
2 //
|
|
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license.
|
|
4
|
37
|
5 using System;
|
|
6
|
|
7 namespace IBBoard.CustomMath
|
|
8 {
|
|
9 /// <summary>
|
|
10 /// Summary description for Comparisons.
|
|
11 /// </summary>
|
|
12 public class Comparisons
|
|
13 {
|
|
14 public static bool ValueWithinAmount(int baseline, int val, int delta)
|
|
15 {
|
|
16 int top = baseline + delta;
|
|
17 int bottom = baseline - delta;
|
|
18
|
|
19 return (val<=top && val>=bottom);
|
|
20 }
|
|
21 }
|
|
22 }
|