1Number::Tolerant::Type(U3s)er Contributed Perl DocumentatNiuomnber::Tolerant::Type(3)
2
3
4
6 Number::Tolerant::Type - a type of tolerance
7
9 version 1.710
10
13 This library should run on perls released even a long time ago. It
14 should work on any version of perl released in the last five years.
15
16 Although it may work on older versions of perl, no guarantee is made
17 that the minimum required version will not be increased. The version
18 may be increased for any reason, and there is no promise that patches
19 will be accepted to lower the minimum required perl.
20
22 valid_args
23 my @args = $type_class->valid_args(@_);
24
25 If the arguments to "valid_args" are valid arguments for this type of
26 tolerance, this method returns their canonical form, suitable for
27 passing to "construct". Otherwise this method returns false.
28
29 construct
30 my $object_guts = $type_class->construct(@args);
31
32 This method is passed the output of the "valid_args" method, and should
33 return a hashref that will become the guts of a new tolerance.
34
35 parse
36 my $tolerance = $type_class->parse($string);
37
38 This method returns a new, fully constructed tolerance from the given
39 string if the given string can be parsed into a tolerance of this type.
40
41 number_re
42 my $number_re = $type_class->number_re;
43
44 This method returns the regular expression (as a "qx" construct) used
45 to match number in parsed strings.
46
47 normalize_number
48 my $number = $type_class->normalize_number($input);
49
50 This method will decide whether the given input is a valid number for
51 use with Number::Tolerant and return it in a canonicalized form.
52 Math::BigInt objects are returned intact. Strings holding numbers are
53 also returned intact. Strings that appears to be fractions are
54 converted to Math::BigRat objects.
55
56 Anything else is considered invalid, and the method will return false.
57
58 variable_re
59 my $variable_re = $type_class->variable_re;
60
61 This method returns the regular expression (as a "qr" construct) used
62 to match the variable in parsed strings.
63
64 When parsing "4 <= x <= 10" this regular expression is used to match
65 the letter "x."
66
68 Ricardo Signes <cpan@semiotic.systems>
69
71 This software is copyright (c) 2004 by Ricardo Signes.
72
73 This is free software; you can redistribute it and/or modify it under
74 the same terms as the Perl 5 programming language system itself.
75
76
77
78perl v5.36.0 2023-01-20 Number::Tolerant::Type(3)