1Test2::Compare::Float(3U)ser Contributed Perl DocumentatiToenst2::Compare::Float(3)
2
3
4
6 Test2::Compare::Float - Compare two values as numbers with tolerance.
7
9 This is used to compare two numbers. You can also check that two
10 numbers are not the same.
11
12 This is similar to Test2::Compare::Number, with extra checks to work
13 around floating point representation issues.
14
15 The optional 'tolerance' parameter controls how close the two numbers
16 must be to be considered equal. Tolerance defaults to 1e-08.
17
18 Note: This will fail if the received value is undefined. It must be a
19 number.
20
21 Note: This will fail if the comparison generates a non-numeric value
22 warning (which will not be shown). This is because it must get a
23 number. The warning is not shown as it will report to a useless line
24 and filename. However, the test diagnostics show both values.
25
27 The source code repository for Test2-Suite can be found at
28 https://github.com/Test-More/Test2-Suite/.
29
31 Chad Granum <exodist@cpan.org>
32
34 Andrew Grangaard <spazm@cpan.org>
35
37 Copyright 2018 Chad Granum <exodist@cpan.org>.
38
39 This program is free software; you can redistribute it and/or modify it
40 under the same terms as Perl itself.
41
42 See http://dev.perl.org/licenses/
43
44
45
46perl v5.36.0 2023-03-23 Test2::Compare::Float(3)