Abdur-rahmaanJ / Abdur-rahmaanJ/richterm

Why steps is `i32`?

Đang mở
#20 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
24
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I have many tasks which progresses way beyond i32 and they're always integer. Could you please modify limits? And what's the reason it's have a sign?

and why do you have update so low precision of `f32` for an update? I understand that final result doesn't require greater precision, but it's harder to calculate progress.

For example, I'm downloading 50GB file, on 100Mb/s network, thus I have at most 12 megabytes of per second. Let's say I've downloaded a chunk of 10 megabytes, so if I divide 50 gigabytes to 10 megabytes, I'll have roughly 0, beyond 6th significant digit of `f32`.

If I have greater initial values or lower speed, I'll have 0 progress.

If the progress bar would have `u64` inside of total and `u64` of progress, no such error would occur

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

Hướng nghiên cứu

Locate the progress-bar implementation and inspect how `steps`, `total`, and update progress are represented and calculated. Compare the current signed `i32` and `f32` choices with the reported large-download case, then define tests that cover large totals and small progress increments; done means those values remain representable and progress updates do not collapse to zero.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.