.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Types::Common::Numeric 3" .TH Types::Common::Numeric 3 2024-03-13 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Types::Common::Numeric \- drop\-in replacement for MooseX::Types::Common::Numeric .SH STATUS .IX Header "STATUS" This module is covered by the Type-Tiny stability policy. .SH DESCRIPTION .IX Header "DESCRIPTION" A drop-in replacement for MooseX::Types::Common::Numeric. .SS Types .IX Subsection "Types" The following types are similar to those described in MooseX::Types::Common::Numeric. .IP \(bu 4 \&\fBPositiveNum\fR .IP \(bu 4 \&\fBPositiveOrZeroNum\fR .IP \(bu 4 \&\fBPositiveInt\fR .IP \(bu 4 \&\fBPositiveOrZeroInt\fR .IP \(bu 4 \&\fBNegativeNum\fR .IP \(bu 4 \&\fBNegativeOrZeroNum\fR .IP \(bu 4 \&\fBNegativeInt\fR .IP \(bu 4 \&\fBNegativeOrZeroInt\fR .IP \(bu 4 \&\fBSingleDigit\fR .Sp \&\f(CW\*(C`SingleDigit\*(C'\fR interestingly accepts the numbers \-9 to \-1; not just 0 to 9. .PP This module also defines an extra pair of type constraints not found in MooseX::Types::Common::Numeric. .IP \(bu 4 \&\fBIntRange[`min, `max]\fR .Sp Type constraint for an integer between min and max. For example: .Sp .Vb 1 \& IntRange[1, 10] .Ve .Sp The maximum can be omitted. .Sp .Vb 1 \& IntRange[10] # at least 10 .Ve .Sp The minimum and maximum are inclusive. .IP \(bu 4 \&\fBNumRange[`min, `max]\fR .Sp Type constraint for a number between min and max. For example: .Sp .Vb 1 \& NumRange[0.1, 10.0] .Ve .Sp As with IntRange, the maximum can be omitted, and the minimum and maximum are inclusive. .Sp Exclusive ranges can be useful for non-integer values, so additional parameters can be given to make the minimum and maximum exclusive. .Sp .Vb 4 \& NumRange[0.1, 10.0, 0, 0] # both inclusive \& NumRange[0.1, 10.0, 0, 1] # exclusive maximum, so 10.0 is invalid \& NumRange[0.1, 10.0, 1, 0] # exclusive minimum, so 0.1 is invalid \& NumRange[0.1, 10.0, 1, 1] # both exclusive .Ve .Sp Making one of the limits exclusive means that a \f(CW\*(C`<\*(C'\fR or \f(CW\*(C`>\*(C'\fR operator will be used instead of the usual \f(CW\*(C`<=\*(C'\fR or \f(CW\*(C`>=\*(C'\fR operators. .SH BUGS .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Types::Standard, Types::Common::String. .PP MooseX::Types::Common, MooseX::Types::Common::Numeric, MooseX::Types::Common::String. .SH AUTHOR .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2013\-2014, 2017\-2023 by Toby Inkster. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.