# Check for numerically similar values

**URL:** <https://forum.kirupa.com/t/check-for-numerically-similar-values/197239>\
**Category:** Uncategorized\
**Created:** [August 14, 2006, 9:27pm UTC](https://forum.kirupa.com/t/check-for-numerically-similar-values/197239 "2006-08-14T21:27:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)\
**Post date:** [August 14, 2006, 9:27pm UTC](https://forum.kirupa.com/t/check-for-numerically-similar-values/197239/1 "2006-08-14T21:27:41Z")

</div>

I have the following code:

```auto

objArray = [main.navHead1, main.navHead2, main.navHead3];
for (q=0; q<objArray.length; q++) {
    objArray[q].a = Math.random()*800;
    objArray[q].b = Math.random()*wVar;
    objArray[q].c = Math.random()*hVar;
}

```

I need to figure out a way to make it so that if any of the values are too close (say, within 50 of each other) it adds a fixed amount to one of the values so that they are no longer that near to each other.

I’m stumped. Any ideas?
