Math::BigInt::Calc - pure Perl module to support Math::BigInt
| Use Case | Command | Description |
|---|---|---|
| Use with Math::BigInt | use Math::BigInt lib => 'Calc'; | Load Calc backend for Math::BigInt |
| Use with Math::BigFloat | use Math::BigFloat lib => 'Calc'; | Load Calc backend for Math::BigFloat |
| Use with Math::BigRat | use Math::BigRat lib => 'Calc'; | Load Calc backend for Math::BigRat |
| Custom base length | use Math::BigInt::Calc base_len => 4; | Set internal base to 10000 |
| Enable use integer | use Math::BigInt::Calc use_int => 1; | Use 'use integer' in computations |
| Both options | use Math::BigInt::Calc base_len => 6, use_int => 1; | Combine base length and use integer |
# to use it with Math::BigInt
use Math::BigInt lib => 'Calc';
# to use it with Math::BigFloat
use Math::BigFloat lib => 'Calc';
# to use it with Math::BigRat
use Math::BigRat lib => 'Calc';
# explicitly set base length and whether to "use integer"
use Math::BigInt::Calc base_len => 4, use_int => 1;
use Math::BigInt lib => 'Calc';
Math::BigInt::Calc inherits from Math::BigInt::Lib.
In this library, the numbers are represented internally in base B = 10**N, where N is the largest possible integer that does not cause overflow in the intermediate computations. The base B elements are stored in an array, with the least significant element stored in array element zero. There are no leading zero elements, except a single zero element when the number is zero. For instance, if B = 10000, the number 1234567890 is represented internally as [7890, 3456, 12].
When the module is loaded, it computes the maximum exponent, i.e., power of 10, that can be used with and without "use integer" in the computations. The default is to use this maximum exponent. If the combination of the 'base_len' value and the 'use_int' value exceeds the maximum value, an error is thrown.
use Math::BigInt::Calc base_len => 4; (use 10000 as internal base).use Math::BigInt::Calc use_int => 1; (use "use integer" internally).This overview contains only the methods that are specific to "Math::BigInt::Calc". For the other methods, see Math::BigInt::Lib.
_base_len(): Specify the desired base length and whether to enable "use integer" in the computations. Usage: Math::BigInt::Calc -> _base_len($base_len, $use_int);. Note that it is better to specify the base length and whether to use integers as options when the module is loaded, e.g., use Math::BigInt::Calc base_len => 6, use_int => 1;.Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-22 00:38 @2600:1f28:365:80b0:d8a5:c3c6:bf94:28c0
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format