September 2017
Beginner
402 pages
9h 52m
English
This is one of the most unusual operators of programming languages. In Perl 6, the =~= operator compares the values for approximate-equality.
The result of an approximate comparison is True if the difference between the operands is less than the value of the $*TOLERANCE variable. Its default value is 1E-15.
Let's check out the two approximations of the value of pi:
say pi =~= 3.14159265358979323846;say pi =~= 3.14;
The first one returns True, while the second is False because it is not accurate enough.