`base_convert`: Same trick as with `to_base_le`, find the largest power of base
- 主要言語
- Rust
- スター
- 225
- フォーク
- 70
- 平均マージ
- 16時間 54分
- マージ済み PR(30日)
- 8
説明
*On 2022-05-28 @recmo wrote in [`b0b5d54`](https://github.com/recmo/uint/commit/b0b5d5401643d19747653934e838604cd59bcd81) “Mod names”:*
Same trick as with `to_base_le`, find the largest power of base
that fits `u64` and accumulate there first.
```rust
base: u64,
digits: I,
) -> Result {
// OPT: Special handling of bases that divide 2^64, and bases that are
// powers of 2.
// OPT: Same trick as with `to_base_le`, find the largest power of base
// that fits `u64` and accumulate there first.
if base < 2 {
return Err(BaseConvertError::InvalidBase(base));
}
let mut result = Self::ZERO;
for digit in digits {
```
*From [`src/base_convert.rs:82`](https://github.com/recmo/uint/blob/b0b5d5401643d19747653934e838604cd59bcd81/src/base_convert.rs#L82)*
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。