Skip to main content

Module bigint

Module bigint 

Source
Expand description

任意精度整数 BigInt の実装。

ECMAScript の BigInt セマンティクスに沿った符号付き多倍長整数。 内部表現は「符号 + ベース 2^32 のリム列(リトルエンディアン: limbs[0] が最下位)」。 ゼロは negative=false かつ limbs 空(正規形)で表す。 no_std 環境のため alloc のみ使用し、除算は素朴な long division を用いる。

Structs§

BigInt
ベース 2^32 のリムで表す符号付き任意精度整数。

Functions§

limbs_to_u64 🔒
リム列(最大 2 リム想定)を u64 に詰める補助。
selftest
BigInt 自己テスト。(pass, total) を返す。 算術・比較・ビット演算・シフト・asIntN/asUintN・パース・文字列化を検証する。