Number...::Type(3pm)
π NAME π
Number::Tolerant::Type β bestie, it's literally just a type of tolerance β¨ it's a base class vibe for all the tolerance types in the Number::Tolerant fam π«Ά
πΈ VERSION πΈ
version 1.710 β periodt π
π¦ SYNOPSIS π¦
okay soβ¦ there's genuinely nothing here π the original page is empty in this section and I'm not about to invent stuff for you, so likeβ¦ no code, no drama, just vibes π (if you wanna see it in action go read the other Number::Tolerant docs, iykyk π)
β PERL VERSION β
no cap, this library should run on perls released even a long time ago π«Ά it should work on any version of perl released in the last five years. iconic behaviour tbh π
ngl though β even though it may work on older versions of perl, there's no guarantee that the minimum required version won't get bumped. the version may be increased for any reason, and there's no promise that patches to lower the minimum required perl will be accepted. so likeβ¦ don't come for her π
π METHODS π
β¨ valid_args β¨
my @args = $type_class->valid_args(@_);
if the args you hand to valid_args are valid arguments for this type of tolerance, this method returns their canonical form β aka the glow-up version that's ready to be passed straight into construct π otherwise? it returns false. simple as that πββοΈ
π construct π
my $object_guts = $type_class->construct(@args);
this one gets handed the output of the valid_args method, and it should return a hashref that becomes the guts of a brand new tolerance π«Ά it's giving frankenstein but make it math β¨
π¦ parse π¦
my $tolerance = $type_class->parse($string);
give her a string and, if that string can be parsed into a tolerance of this type, she returns a new, fully constructed tolerance π₯ if notβ¦ well, you get the idea π
πΈ number_re πΈ
my $number_re = $type_class->number_re;
returns the regular expression β as a qx construct, bestie, don't forget β that's used to match a number in parsed strings β
π normalize_number π
my $number = $type_class->normalize_number($input);
this method decides whether the input you gave it is a valid number for use with Number::Tolerant, and if it is, returns it in a canonicalized form π
the deets, fr fr:
Math::BigIntobjects are returned intact π- strings holding numbers are also returned intact π
- strings that appear to be fractions get converted into
Math::BigRatobjects π₯
anything else is considered invalid, and the method will return false π« no notes.
π§ variable_re π§
my $variable_re = $type_class->variable_re;
returns the regular expression β this time as a qr construct, okay bestie, different letter, keep up π
β used to match the variable in parsed strings.
when parsing 4 <= x <= 10, this regular expression is what matches the letter x. π
π AUTHOR π
Ricardo Signes <cpan@semiotic.systems> β we stan π«Ά
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2004 by Ricardo Signes.
it's free software, bestie π you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay.
and that's the whole page, no crumbs left behind π
perl v5.36.0 Β· 2023-01-08 Β· Number...::Type(3pm) β mwah, thanks for reading, ily, go write some tolerant numbers ππ
π¦ where this page comes from
- debian bookworm: libnumber-tolerant-perl 1.710-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnumber-tolerant-perl 1.710-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnumber-tolerant-perl 1.710-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnumber-tolerant-perl 1.710-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnumber-tolerant-perl 1.710-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms