# How can I get the similarity and dissimilarity of two real numbers?

I would like to calculate the similarity and/or dissimilarity between two real numbers. The challenge is, we can have multiple types of real numbers. Say for example,

Case-1: (0.5, 1.77) or (-0.5, -1.77) both on the same sides (positive or negative) and the difference between them is not very high.

Case-2: (0.5, -1.77) or (-0.5, 1.77) both on the opposite sides (positive and negative), and the difference between them is not very high.

Case-3: (0.5, 30.77) or (-0.5, -30.77) both on the same sides (positive or negative) and the difference between them is very high.

Case-4: (0.5, 30.77) or (-0.5, -30.77) both on the opposite sides (positive and negative), and the difference between them is very high.

Case-5: (0.00, 30.77) or (0.00, -30.77) both of them (zero and positive or negative side) and the difference is very high and (0.00, 3.77) or (0.00, -3.77) both of them (zero and positive or negative side) and the difference is not very high.

Many more...

Maybe we can use Jaccard or Cosine similarity, but not sure about the appropriateness of these methods with the problem!

Now, I would like to know, are there any other formal methods to calculate the similarity and dissimilarity between these two real number pairs?