目錄

名稱

Math::BigInt::FastCalc - Math::BigInt::Calc 其中包含一些 XS 可提升速度

語法

# to use it with Math::BigInt
use Math::BigInt lib => 'FastCalc';

# to use it with Math::BigFloat
use Math::BigFloat lib => 'FastCalc';

# to use it with Math::BigRat
use Math::BigRat lib => 'FastCalc';

說明

Math::BigInt::FastCalc 繼承自 Math::BigInt::Calc。

提供支援大整數運算。不打算讓其他模組使用。其他具有相同功能的模組也可以用來支援 Math::BigInt,例如 Math::BigInt::GMPMath::BigInt::Pari

為了允許使用多個大整數函式庫,Math::BigInt 已重新編寫,以使用函式庫模組作為核心數學例程。任何遵循與此相同的 API 的模組都可以透過使用下列方式來使用

use Math::BigInt lib => 'libname';

'libname' 是長名稱 ('Math::BigInt::Pari') 或僅為簡短版本,例如 'Pari'。若要使用此函式庫

use Math::BigInt lib => 'FastCalc';

預設行為是選擇大整數的最佳內部表示形式,但內部表示形式中使用的基本長度可以明確指定。請注意,這必須在載入 Math::BigInt 之前完成。例如,

use Math::BigInt::FastCalc base_len => 3;
use Math::BigInt lib => 'FastCalc';

儲存

Math::BigInt::FastCalc 的運作方式與 Math::BigInt::Calc 完全相同。數字以十進位形式儲存在切成數個部分中。

方法

下列函式現已在 FastCalc.xs 中實作

_is_odd         _is_even        _is_one         _is_zero
_is_two         _is_ten
_zero           _one            _two            _ten
_acmp           _len
_inc            _dec
__strip_zeros   _copy

錯誤

請將任何錯誤或功能要求回報至 bug-math-bigint-fastcalc at rt.cpan.org,或透過網路介面 https://rt.cpan.org/Ticket/Create.html?Queue=Math-BigInt-FastCalc(需要登入)。我們將會收到通知,然後當我進行變更時,您會自動收到錯誤進度的通知。

支援

安裝後,您可以使用 perldoc 指令找到此模組的說明文件。

perldoc Math::BigInt::FastCalc

您也可以在以下位置尋找資訊

GitHub

https://github.com/pjacklam/p5-Math-BigInt-FastCalc

RT:CPAN 的要求追蹤器

https://rt.cpan.org/Dist/Display.html?Name=Math-BigInt-FastCalc

MetaCPAN

https://metacpan.org/release/Math-BigInt-FastCalc

CPAN 測試人員矩陣

http://matrix.cpantesters.org/?dist=Math-BigInt-FastCalc

CPAN 評分

https://cpanratings.perl.org/dist/Math-BigInt-FastCalc

授權

此程式為免費軟體;您可以在與 Perl 相同的條款下重新散布或修改它。

作者

原先的數學程式碼由 Mark Biggar 編寫,Tels http://bloodgate.com/ 在 2000 年底重新撰寫。

從 Math::BigInt 分離,並在 John Peacock 的協助下塑造 API。

由 Tels http://bloodgate.com 2001-2003 修復、加速和增強。Tels 2004-2007 進一步簡化(api_version 1 等)。

由 Peter John Acklam <pjacklam@gmail.com> 2010-2021 維護。

另請參閱

Math::BigInt::Lib,以取得 API 的說明。

替代函式庫 Math::BigInt::CalcMath::BigInt::GMPMath::BigInt::Pari

使用這些函式庫的一些模組 Math::BigIntMath::BigFloatMath::BigRat