|
|
|
|
|
by masklinn
2915 days ago
|
|
There is no type safety issue, and there is no cast. Div on integral types is explicitly implementing as an integer/truncating division: https://doc.rust-lang.org/src/core/ops/arith.rs.html#436-452 There would be no type-safety issue or cast if it were implemented as a real division either, incidentally. There is room to argue Div should not have been implemented at all on integral types (as in Haskell where integer division is a separate operation entirely), but that's a completely different issue. |
|