Gen. partnerAlgotech

Similar numbers - how to recognize it

In the past, this article has described methods to recognize similar numbers.

|
August 23, 2019

In the past, this article has described methods to recognize similar numbers.

For example, 500 199 Kč and 500 210 Kč are almost the same.

The solution is to calculate the proportion and compare against epsilon.

$x = 500199;
$y = 500210;
$epsilon = 0.001;
if (abs($x / $y) < $epsilon) {
// The numbers are similar
}
Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.