Ok. I understand the code.

Except I need to expand on the code you provided.

My origional problem was Closest to 0; I later clarified Closest to N. Ideally, I want to send the offset as N how would I pass the parameter of N in this case?

```
num() = {3, 12, -.123, 5.1, 1002, 23}
Function AbsSort(x As Single, y As Single) As Integer
Return Math.Abs(x).CompareTo(Math.Abs(y))
End Function
Array.Sort(num, AddressOf AbsSort)
```

Pseduo Code of :

```
num() = {3, 12, -.123, 5.1, 1002, 23}
Function AbsSort([B][I]n as decimal[/I][/B], x As Single, y As Single) As Integer
Return Math.Abs(x[B][I]-n[/I][/B]).CompareTo(Math.Abs(y)[B][I]+n[/I][/B])
End Function
Array.Sort(num, AddressOf AbsSort)
```

How do I determine my signs?

The only solution I know works (doesn't mean it's the only one available), I much rather do it the way you have expressed it can be done, is...

Take the array (num)

Create 2 temporary Arrays (NumLower, NumUpper)

Move everything that is lower then N into NumLower

Move everything that is Higher or equal to N into NumUpper

Sort NumLower and NumUpper

Recombine according to Values differences.

Are you suggesting something like

```
num() = {3, 12, -.123, 5.1, 1002, 23}
Function AbsSort([B][I]n as decimal[/I][/B], x As Single, y As Single) As Integer
Dim x1 as single = x
Dim y1 as single = y
If (x>n) then
x1 = x-n
y1 = y+n
Else
x1 = x+n
y1 = y-n
End If
Return Math.Abs([B][I]x1[/I][/B]).CompareTo(Math.Abs([B][I]y1[/I][/B]))
End Function
Array.Sort(num, AddressOf AbsSort)
```

I would rather sort using the above method; if you can suggest away of passing N that I am totally overlooking.