diff options
author | Justin Clarke Casey | 2008-02-08 18:18:56 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-02-08 18:18:56 +0000 |
commit | 24ac86931a79b3968c5c6c00f93bb92bf967ea75 (patch) | |
tree | fbc90f13b13a3e7024ab92f3238746da85f3ae62 /OpenSim/Tests/Common/ANumericalToleranceConstraint.cs | |
parent | * Made some terrain functions faster computationally. (diff) | |
download | opensim-SC-24ac86931a79b3968c5c6c00f93bb92bf967ea75.zip opensim-SC-24ac86931a79b3968c5c6c00f93bb92bf967ea75.tar.gz opensim-SC-24ac86931a79b3968c5c6c00f93bb92bf967ea75.tar.bz2 opensim-SC-24ac86931a79b3968c5c6c00f93bb92bf967ea75.tar.xz |
update eol-style
Diffstat (limited to 'OpenSim/Tests/Common/ANumericalToleranceConstraint.cs')
-rw-r--r-- | OpenSim/Tests/Common/ANumericalToleranceConstraint.cs | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/OpenSim/Tests/Common/ANumericalToleranceConstraint.cs b/OpenSim/Tests/Common/ANumericalToleranceConstraint.cs index 289e4bb..2a6993d 100644 --- a/OpenSim/Tests/Common/ANumericalToleranceConstraint.cs +++ b/OpenSim/Tests/Common/ANumericalToleranceConstraint.cs | |||
@@ -1,30 +1,30 @@ | |||
1 | using System; | 1 | using System; |
2 | using NUnit.Framework.Constraints; | 2 | using NUnit.Framework.Constraints; |
3 | 3 | ||
4 | namespace OpenSim.Tests.Common | 4 | namespace OpenSim.Tests.Common |
5 | { | 5 | { |
6 | public abstract class ANumericalToleranceConstraint : Constraint | 6 | public abstract class ANumericalToleranceConstraint : Constraint |
7 | { | 7 | { |
8 | protected double _tolerance; | 8 | protected double _tolerance; |
9 | 9 | ||
10 | public ANumericalToleranceConstraint(double tolerance) | 10 | public ANumericalToleranceConstraint(double tolerance) |
11 | { | 11 | { |
12 | if (tolerance < 0) | 12 | if (tolerance < 0) |
13 | { | 13 | { |
14 | throw new ArgumentException("Tolerance cannot be negative."); | 14 | throw new ArgumentException("Tolerance cannot be negative."); |
15 | } | 15 | } |
16 | _tolerance = tolerance; | 16 | _tolerance = tolerance; |
17 | } | 17 | } |
18 | 18 | ||
19 | 19 | ||
20 | protected bool IsWithinDoubleConstraint(double doubleValue, double baseValue) | 20 | protected bool IsWithinDoubleConstraint(double doubleValue, double baseValue) |
21 | { | 21 | { |
22 | if (doubleValue >= baseValue - _tolerance && doubleValue <= baseValue + _tolerance) | 22 | if (doubleValue >= baseValue - _tolerance && doubleValue <= baseValue + _tolerance) |
23 | { | 23 | { |
24 | return true; | 24 | return true; |
25 | } | 25 | } |
26 | 26 | ||
27 | return false; | 27 | return false; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | } | 30 | } |