# Similarity fail

Hello, and first of all, thanks for reading and answering.

Here is the question, I attach image. Shouldn´t it be FALSE instead of TRUE?

Thanks!!!

similarity|625x500

Threshold is not numerical difference, read the input description, it is percentage.

Just out of curiosity, what is the percentage referring to? X% of the first number? Second number? Average?

I believe it is the percentage difference between them. If you want by tolerance I have in Pufferfish a Equality within Tolerance component.

But 10% should be 110 or less not 111, 111 it is 11% isn´t?

Depends, 10% of 100 is 10, 10% of 111 is 11.1

I seem to remember the percentage applies to the bigger of the two numbers.

Would maybe make sense to document this in the component description? Or wouldn’t it rather make sense to use the second number (“number to compare to”) as reference for the percentage then?

i discovered the formula, if you multiply de threshold * second number and if it is lower than de absolute difference value it is TRUE but if it is higher it gives a FALSE

I don’t think so, there’s a lot of symmetry in a comparison despite the fact that the values are ordered. I think it would be weird if two numbers either are or aren’t similar depending on the order alone.

In general percentage-compare is a bit too human-centric a metric to be genuinely useful. I think we’ll need to add more components for this sort of thing, and yes they’ll have to be properly documented.