rust/library/core/tests
bors e702534763 Auto merge of #102935 - ajtribick:display-float-0.5-fixed-0, r=scottmcm
Fix inconsistent rounding of 0.5 when formatted to 0 decimal places

As described in #70336, when displaying values to zero decimal places the value of 0.5 is rounded to 1, which is inconsistent with the display of other half-integer values which round to even.

From testing the flt2dec implementation, it looks like this comes down to the condition in the fixed-width Dragon implementation where an empty buffer is treated as a case to apply rounding up. I believe the change below fixes it and updates only the relevant tests.

Nevertheless I am aware this is very much a core piece of functionality, so please take a very careful look to make sure I haven't missed anything. I hope this change does not break anything in the wider ecosystem as having a consistent rounding behaviour in floating point formatting is in my opinion a useful feature to have.

Resolves #70336
2022-11-16 07:20:30 +00:00
..
fmt Add tests for rounding of ties during float formatting 2022-10-20 22:09:24 +02:00
hash Test const Hash, fix nits 2022-11-08 17:39:40 +01:00
iter simplification: do not process the ArrayChunks remainder in fold() 2022-11-07 21:44:25 +01:00
num Auto merge of #102935 - ajtribick:display-float-0.5-fixed-0, r=scottmcm 2022-11-16 07:20:30 +00:00
ops
panic Fix test (location_const_file) 2022-10-08 11:48:53 +00:00
alloc.rs
any.rs Format dyn Trait better in type_name intrinsic 2022-11-01 20:41:47 +00:00
array.rs
ascii.rs introduce {char, u8}::is_ascii_octdigit 2022-09-27 11:55:13 +05:30
asserting.rs
atomic.rs Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
bool.rs
cell.rs
char.rs
clone.rs
cmp.rs
const_ptr.rs
convert.rs
future.rs
intrinsics.rs
lazy.rs
lib.rs Rollup merge of #104060 - ink-feather-org:const_hash, r=fee1-dead 2022-11-10 10:47:38 -05:00
macros.rs
manually_drop.rs
mem.rs interpret: fix align_of_val on packed types 2022-10-29 15:58:32 +02:00
nonzero.rs
ops.rs
option.rs cfg-step code 2022-11-06 17:21:21 -05:00
panic.rs Add newlines 2022-09-27 19:23:52 +00:00
pattern.rs
pin_macro.rs
pin.rs
ptr.rs Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
result.rs Remove unstable Result::into_ok_or_err 2022-08-17 17:20:42 -07:00
simd.rs
slice.rs make const_err a hard error 2022-10-07 18:08:49 +02:00
str_lossy.rs Expose Utf8Lossy as Utf8Chunks 2022-08-20 12:49:20 -04:00
str.rs
task.rs Made from_waker, waker, from_raw const 2022-09-14 14:53:16 +02:00
time.rs Fix Duration::{try_,}from_secs_f{32,64}(-0.0) 2022-10-14 16:07:09 +01:00
tuple.rs
unicode.rs
waker.rs