How to get difference between two values

Ok. You guys know the good ol’ useful: “if(Vector3.Distance(Pos1, Pos2) > Value)”, right?

Now I have a question. How in the world can I apply that same method to 2 simple floats or intigers?

I have 2 floats in a script of mine. And I need to get the value difference between the two. It doesn’t matter how large the floats may be. They both could be 10310 and 10350. But the difference between them would still be 40. So how do I get that value difference?

if(Mathf.Abs(num1 - num2) > Value)

I maned my own fungtion:

int diffrence(int num1,int num2)
{
    int cout;

    cout = Mathf.Max(num2, num1) - Mathf.Min(num1, num2);

    return cout;
}

example:

int myExemple = difference(13,10);

it mean my example is 3