1Types::Common::Numeric(U3s)er Contributed Perl DocumentatTiyopnes::Common::Numeric(3)
2
3
4
6 Types::Common::Numeric - drop-in replacement for
7 MooseX::Types::Common::Numeric
8
10 This module is covered by the Type-Tiny stability policy.
11
13 A drop-in replacement for MooseX::Types::Common::Numeric.
14
15 Types
16 The following types are similar to those described in
17 MooseX::Types::Common::Numeric.
18
19 "PositiveNum"
20 "PositiveOrZeroNum"
21 "PositiveInt"
22 "PositiveOrZeroInt"
23 "NegativeNum"
24 "NegativeOrZeroNum"
25 "NegativeInt"
26 "NegativeOrZeroInt"
27 "SingleDigit"
28 "SingleDigit" interestingly accepts the numbers -9 to -1; not just
29 0 to 9.
30
31 This module also defines an extra pair of type constraints not found in
32 MooseX::Types::Common::Numeric.
33
34 "IntRange[`min, `max]"
35 Type constraint for an integer between min and max. For example:
36
37 IntRange[1, 10]
38
39 The maximum can be omitted.
40
41 IntRange[10] # at least 10
42
43 The minimum and maximum are inclusive.
44
45 "NumRange[`min, `max]"
46 Type constraint for a number between min and max. For example:
47
48 NumRange[0.1, 10.0]
49
50 As with IntRange, the maximum can be omitted, and the minimum and
51 maximum are inclusive.
52
53 Exclusive ranges can be useful for non-integer values, so
54 additional parameters can be given to make the minimum and maximum
55 exclusive.
56
57 NumRange[0.1, 10.0, 0, 0] # both inclusive
58 NumRange[0.1, 10.0, 0, 1] # exclusive maximum, so 10.0 is invalid
59 NumRange[0.1, 10.0, 1, 0] # exclusive minimum, so 0.1 is invalid
60 NumRange[0.1, 10.0, 1, 1] # both exclusive
61
62 Making one of the limits exclusive means that a "<" or ">" operator
63 will be used instead of the usual "<=" or ">=" operators.
64
66 Please report any bugs to
67 <http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny>.
68
70 Types::Standard, Types::Common::String.
71
72 MooseX::Types::Common, MooseX::Types::Common::Numeric,
73 MooseX::Types::Common::String.
74
76 Toby Inkster <tobyink@cpan.org>.
77
79 This software is copyright (c) 2013-2014, 2017-2019 by Toby Inkster.
80
81 This is free software; you can redistribute it and/or modify it under
82 the same terms as the Perl 5 programming language system itself.
83
85 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
86 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
87 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
88
89
90
91perl v5.28.1 2019-01-08 Types::Common::Numeric(3)