# Thread: How to Calm Unruly [ARRAYS]

1. ## How to Calm Unruly [ARRAYS]

I am using a looped array in which a mathematical equation is derived. I have set the following:

Code:
```int answer;

answer = AnotherEquation * TheSecondEquation + AbunchOfOtherCrud
/ ThisGetsPrettyComplicated;

loop goes here:::::::::::

if answer = array1[i]/array2[z]

{then do this}```
The problem is it is too sensitive. I would like to set ranges (+/- 5%) in order to find a ballpark or I would never get an answer.

I would prefer to have the range set in the output from the array (for instance the higher the number the more range I would like -whereas the lower numbers would receive less range).

Thanks to all! I appreciate you not letting me feel like a total C++ moron.

2. It is quite hard to tell anything. What exactly are you doing? What are array1 and array2? Where do you get i and z from etc.

3. So, if the values are within 5 percent, array1[i]/array2[z] should be between 0.95 and 1.05.

4. Take the absolute of the difference, convert it to floating point, divide by the original value and see if the result is <= 0.05.

Popular pages Recent additions