Types::...Numeric(3)

πŸ’– NAME πŸ’–

okay so bestie, this is Types::Common::Numeric β€” a drop-in replacement for MooseX::Types::Common::Numeric. that's literally it, that's the whole name, slay. πŸŽ€


✨ STATUS ✨

This module is covered by the Type-Tiny stability policy. iconic behavior honestly 🫢


🌸 DESCRIPTION 🌸

A drop-in replacement for MooseX::Types::Common::Numeric. no notes, it just is the thing. πŸ’…

πŸ¦‹ Types πŸ¦‹

The following types are similar to those described in MooseX::Types::Common::Numeric:

  • PositiveNum
  • PositiveOrZeroNum
  • PositiveInt
  • PositiveOrZeroInt
  • NegativeNum
  • NegativeOrZeroNum
  • NegativeInt
  • NegativeOrZeroInt
  • SingleDigit
not me being obsessed with this: SingleDigit interestingly accepts the numbers -9 to -1; not just 0 to 9. the plot twist?? 😭 the range is giving "both ends of the single-digit spectrum", periodt.

This module also defines an extra pair of type constraints not found in MooseX::Types::Common::Numeric. bestie they're NEW, they're exclusive to us πŸŽ€

  • IntRange[`min, `max] β€” type constraint for an integer between min and max. for example:
IntRange[1, 10]

the maximum can be omitted.

IntRange[10]   # at least 10

the minimum and maximum are inclusive. both of them. no sneaky exclusions. ✨

  • NumRange[`min, `max] β€” type constraint for a number between min and max. for example:
NumRange[0.1, 10.0]

as with IntRange, the maximum can be omitted, and the minimum and maximum are inclusive. same energy fr fr.

exclusive ranges can be useful for non-integer values, so additional parameters can be given to make the minimum and maximum exclusive. iykyk:

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

making one of the limits exclusive means that a < or > operator will be used instead of the usual <= or >= operators. lowkey the strictest boundary enforcement ever πŸ’€


πŸ› BUGS πŸ›

please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>. do it, bestie, the maintainers wanna hear from you 🫢


πŸ‘€ SEE ALSO πŸ‘€

Types::Standard, Types::Common::String.

MooseX::Types::Common, MooseX::Types::Common::Numeric, MooseX::Types::Common::String.


πŸ‘‘ AUTHOR πŸ‘‘

Toby Inkster <tobyink@cpan.org>. main character, honestly. 🌟


This software is copyright (c) 2013-2014, 2017-2025 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in go off, do your thing 🌈


🌺 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.

okay that one's shouty because it MEANS it, no cap β€” no promises, no refunds, no vibes-based guarantees. πŸ™ˆ


and that's the whole page, bestie!! this was Types::...Numeric(3) from perl v5.42.0, dated 2026-01-17 β€” mwah, stan a classic, catch you in the next manpage πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from