Math::B...::CalcPP(3)
π NAME π
Math::Base::Convert::CalcPP β bestie, this is the module that holds all the standard methods that Math::Base::Convert leans on to do its thing. π«Ά
It ships as part of the User Contributed Perl Documentation collection, and yes it's Math::B...::CalcPP(3) if you're looking at the manual page itself. β¨
β¨ DESCRIPTION β¨
So like, this module is literally just a little backstage crew. It contains the standard methods that Math::Base::Convert uses to convert a number in one base into a number in another base. No drama, just math. π
$carry = addbaseno($reg32ptr,$int)β this function adds an integer that's less than65536to a longn*32bit register, and hands you back the carry. That's it, that's the whole vibe. πmultiply($reg32ptr,$int)β this one multiplies a longn*32bit register by an integer less than65536. Iconic behavior honestly. π₯($qptr,$remainder) = dividebybase($reg32ptr,$int)β this function divides a longn*32bit register by an integer less than65536, and returns a pointer to a longn*32bit quotient plus an integer remainder. Two-for-one, we love a multitasker. π$bc->useFROMbaseto32wideβ this method converts FROM an input base string to a longn*32bit register, using an algorithim like:
$longnum = 0;
for $char ( $in_str =~ /./g ) {
$longnum *= $base;
$longnum += $value{$char)
}
return $number;
$output = $bc->use32wideTObaseβ and this method converts a longn*32bit register TO a base number, using an algorithim like:
$output = '';
while( $longnum > 0 ) {
$output = ( $longnum % $base ) . $output;
$num = int( $longnum / $base );
}
return $output;
not me reading those snippets like a bedtime story π β copy them exactly if you're playing along at home, bestie, the code is the code.
π AUTHOR π
Michael Robinton, michael@bizsystems.com β shoutout to the dev, no cap. πΈ
π COPYRIGHT π
Copyright 2012-15, Michael Robinton π
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. π¦
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. π (fr fr, that part matters, don't skip it.)
okay that's the whole page bestie, you ate that π«Ά β this lil' manual page came to you courtesy of perl v5.42.0, dated 2025-09-16, and yes it's still giving Math::B...::CalcPP(3) energy. periodt. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Math-Base-Convert 0.13-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms