http://qs1969.pair.com?node_id=11128848


in reply to Re: Check whether two numbers are within a range
in thread Check whether two numbers are within a range

Thank you. This works well, regardless if the vehicle's actual location will be plus or minus the pre-determined coordinates I'll be comparing against.

Mock up:

use warnings; use strict; use feature 'say'; use constant { ACCURACY => 1e5, RANGE => 1.2, LON => -119.31665, }; my $lon_current = -119.31666; my $deviation = abs(ACCURACY * (LON - $lon_current)); say "Within range: $deviation" if $deviation < RANGE;