about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/rustc.rs
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-10-26 18:44:05 +0200
committerUrgau <urgau@numericable.fr>2024-10-26 18:46:41 +0200
commit00444bab2602ca487be08d5e2eaa6179833333b8 (patch)
tree6a00b3f33fae026dab91af8b5afc2ae9283628be /compiler/rustc_pattern_analysis/src/rustc.rs
parent80d0d927d5069b67cc08c0c65b48e7b6e0cdeeb5 (diff)
downloadrust-00444bab2602ca487be08d5e2eaa6179833333b8.tar.gz
rust-00444bab2602ca487be08d5e2eaa6179833333b8.zip
Round negative signed integer towards zero in `iN::midpoint`
Instead of towards negative infinity as is currently the case.

This done so that the obvious expectations of
`midpoint(a, b) == midpoint(b, a)` and
`midpoint(-a, -b) == -midpoint(a, b)` are true, which makes the even
more obvious implementation `(a + b) / 2` true.

https://github.com/rust-lang/rust/issues/110840#issuecomment-2336753931
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs')
0 files changed, 0 insertions, 0 deletions