HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/share/man/man3/Types::Common::Numeric.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" 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
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    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 "2021-07-31" "perl v5.26.3" "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
<https://github.com/tobyink/p5\-type\-tiny/issues>.
.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 <tobyink@cpan.org>.
.SH "COPYRIGHT AND LICENCE"
.IX Header "COPYRIGHT AND LICENCE"
This software is copyright (c) 2013\-2014, 2017\-2021 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"
\&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0