`log`: Find out exactly where the precision is lost and what
- Ngôn ngữ chính
- Rust
- Star
- 225
- Fork
- 70
- Merge trung bình
- 16 giờ 54 phút
- Pull request đã merge (30 ngày)
- 8
Mô tả
*On 2022-05-31 @recmo wrote in [`c1a0c34`](https://github.com/recmo/uint/commit/c1a0c34df8ab6d3411ad79c27b72ad812eff78e4) “Merge pull request #97 from recmo/isqrt”:*
Find out exactly where the precision is lost and what
the bounds are.
```rust
let log = value.approx_log2();
let pow = U::approx_pow2(log).unwrap();
let error = value.abs_diff(pow);
let correct_bits = value.bit_len() - error.bit_len();
// The maximum precision we could expect here is 53 bits.
// OPT: Find out exactly where the precision is lost and what
// the bounds are.
assert!(correct_bits == value.bit_len() || correct_bits >= 42);
});
});
}
```
*From [`src/log.rs:150`](https://github.com/recmo/uint/blob/c1a0c34df8ab6d3411ad79c27b72ad812eff78e4/src/log.rs#L150)*
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.