| 1 | use lexical_utilrust-analyzer cargo lexical-util 1.0.7 crate/::numrust-analyzer cargo lexical-util 1.0.7 num/; |
| 2 | |
| 3 | fn as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().<T: numrust-analyzer cargo lexical-util 1.0.7 num/::AsPrimitiverust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#>(t: T) { |
| 4 | let _: u8 = t.as_u8rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_u8().(); |
| 5 | let _: u16 = t.as_u16rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_u16().(); |
| 6 | let _: u32 = t.as_u32rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_u32().(); |
| 7 | let _: u64 = t.as_u64rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_u64().(); |
| 8 | let _: u128 = t.as_u128rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_u128().(); |
| 9 | let _: usize = t.as_usizerust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_usize().(); |
| 10 | let _: i8 = t.as_i8rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_i8().(); |
| 11 | let _: i16 = t.as_i16rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_i16().(); |
| 12 | let _: i32 = t.as_i32rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_i32().(); |
| 13 | let _: i64 = t.as_i64rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_i64().(); |
| 14 | let _: i128 = t.as_i128rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_i128().(); |
| 15 | let _: isize = t.as_isizerust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_isize().(); |
| 16 | let _: f32 = t.as_f32rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_f32().(); |
| 17 | let _: f64 = t.as_f64rust-analyzer cargo lexical-util 1.0.7 num/AsPrimitive#as_f64().(); |
| 18 | } |
| 19 | |
| 20 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 21 | fn as_primitive_testrust-analyzer cargo lexical-util 1.0.7 as_primitive_test().() { |
| 22 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1u8); |
| 23 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1u16); |
| 24 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1u32); |
| 25 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1u64); |
| 26 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1u128); |
| 27 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1usize); |
| 28 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1i8); |
| 29 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1i16); |
| 30 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1i32); |
| 31 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1i64); |
| 32 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1i128); |
| 33 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1isize); |
| 34 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1f32); |
| 35 | as_primitiverust-analyzer cargo lexical-util 1.0.7 as_primitive().(1f64); |
| 36 | } |
| 37 | |
| 38 | fn as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().<T: numrust-analyzer cargo lexical-util 1.0.7 num/::AsCastrust-analyzer cargo lexical-util 1.0.7 num/AsCast#>(t: T) { |
| 39 | let _: i8 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 40 | let _: i16 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 41 | let _: i32 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 42 | let _: i64 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 43 | let _: i128 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 44 | let _: isize = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 45 | let _: u8 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 46 | let _: u16 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 47 | let _: u32 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 48 | let _: u64 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 49 | let _: u128 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 50 | let _: usize = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 51 | let _: f32 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 52 | let _: f64 = numrust-analyzer cargo lexical-util 1.0.7 num/::as_castrust-analyzer cargo lexical-util 1.0.7 num/as_cast().(t); |
| 53 | } |
| 54 | |
| 55 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 56 | fn as_cast_testrust-analyzer cargo lexical-util 1.0.7 as_cast_test().() { |
| 57 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1u8); |
| 58 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1u16); |
| 59 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1u32); |
| 60 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1u64); |
| 61 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1u128); |
| 62 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1usize); |
| 63 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1i8); |
| 64 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1i16); |
| 65 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1i32); |
| 66 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1i64); |
| 67 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1i128); |
| 68 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1isize); |
| 69 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1f32); |
| 70 | as_castrust-analyzer cargo lexical-util 1.0.7 as_cast().(1f64); |
| 71 | } |
| 72 | |
| 73 | fn check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().<T: numrust-analyzer cargo lexical-util 1.0.7 num/::Numberrust-analyzer cargo lexical-util 1.0.7 num/Number#>(x: T, mut y: T) { |
| 74 | // Copy, partialeq, partialord |
| 75 | let _ = x; |
| 76 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#lt(). y); |
| 77 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x != y); |
| 78 | |
| 79 | // Operations |
| 80 | let _ = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().x; |
| 81 | let _ = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().x; |
| 82 | let _ = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().x; |
| 83 | let _ = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div().x; |
| 84 | let _ = y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().x; |
| 85 | y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().x; |
| 86 | y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().x; |
| 87 | y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().x; |
| 88 | y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign()./=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign().x; |
| 89 | y rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().%=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().x; |
| 90 | |
| 91 | // Conversions already tested. |
| 92 | } |
| 93 | |
| 94 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 95 | fn number_testrust-analyzer cargo lexical-util 1.0.7 number_test().() { |
| 96 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1u8, 5); |
| 97 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1u16, 5); |
| 98 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1u32, 5); |
| 99 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1u64, 5); |
| 100 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1u128, 5); |
| 101 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1usize, 5); |
| 102 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1i8, 5); |
| 103 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1i16, 5); |
| 104 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1i32, 5); |
| 105 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1i64, 5); |
| 106 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1i128, 5); |
| 107 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1isize, 5); |
| 108 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1f32, 5.0); |
| 109 | check_numberrust-analyzer cargo lexical-util 1.0.7 check_number().(1f64, 5.0); |
| 110 | } |
| 111 | |
| 112 | fn check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().<T: numrust-analyzer cargo lexical-util 1.0.7 num/::Integerrust-analyzer cargo lexical-util 1.0.7 num/Integer#>(mut x: T) { |
| 113 | // Copy, partialeq, partialord, ord, eq |
| 114 | let _ = x; |
| 115 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#gt(). T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.); |
| 116 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x != T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.); |
| 117 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(x.minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#min().(T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.), T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.); |
| 118 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(x.maxrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord#max().(T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.), x); |
| 119 | |
| 120 | // Operations |
| 121 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 122 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 123 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 124 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 125 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 126 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 127 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 128 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 129 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign()./=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 130 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().%=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 131 | |
| 132 | // Bitwise operations |
| 133 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 134 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr#bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr#bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOr#bitor().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 135 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXor#bitxor().^rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXor#bitxor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXor#bitxor().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 136 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAndAssign#bitand_assign().&=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAndAssign#bitand_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAndAssign#bitand_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 137 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOrAssign#bitor_assign().|=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOrAssign#bitor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitOrAssign#bitor_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 138 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXorAssign#bitxor_assign().^=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXorAssign#bitxor_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitXorAssign#bitxor_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Integer#ONE.; |
| 139 | |
| 140 | // Bit shifts |
| 141 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shl#shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shl#shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shl#shl().1i32; |
| 142 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shr#shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shr#shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/Shr#shr().1i32; |
| 143 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShlAssign#shl_assign().<<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShlAssign#shl_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShlAssign#shl_assign().1i32; |
| 144 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShrAssign#shr_assign().>>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShrAssign#shr_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/ShrAssign#shr_assign().1i32; |
| 145 | |
| 146 | // Conversions already tested. |
| 147 | } |
| 148 | |
| 149 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 150 | fn integer_testrust-analyzer cargo lexical-util 1.0.7 integer_test().() { |
| 151 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65u8); |
| 152 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65u16); |
| 153 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65u32); |
| 154 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65u64); |
| 155 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65u128); |
| 156 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65usize); |
| 157 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65i8); |
| 158 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65i16); |
| 159 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65i32); |
| 160 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65i64); |
| 161 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65i128); |
| 162 | check_integerrust-analyzer cargo lexical-util 1.0.7 check_integer().(65isize); |
| 163 | } |
| 164 | |
| 165 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 166 | fn ceil_divmod_testrust-analyzer cargo lexical-util 1.0.7 ceil_divmod_test().() { |
| 167 | use lexical_utilrust-analyzer cargo lexical-util 1.0.7 crate/::numrust-analyzer cargo lexical-util 1.0.7 num/::Integerrust-analyzer cargo lexical-util 1.0.7 num/Integer#; |
| 168 | |
| 169 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(5usize.ceil_divmodrust-analyzer cargo lexical-util 1.0.7 num/Integer#ceil_divmod().(7), (1, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().2)); |
| 170 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(0usize.ceil_divmodrust-analyzer cargo lexical-util 1.0.7 num/Integer#ceil_divmod().(7), (0, 0)); |
| 171 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(35usize.ceil_divmodrust-analyzer cargo lexical-util 1.0.7 num/Integer#ceil_divmod().(7), (5, 0)); |
| 172 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(36usize.ceil_divmodrust-analyzer cargo lexical-util 1.0.7 num/Integer#ceil_divmod().(7), (6, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().6)); |
| 173 | } |
| 174 | |
| 175 | #[cfg(any(feature = "parse-floats", feature = "write-floats"))] |
| 176 | fn check_floatrust-analyzer cargo lexical-util 1.0.7 check_float().<T: numrust-analyzer cargo lexical-util 1.0.7 num/::Floatrust-analyzer cargo lexical-util 1.0.7 num/Float#>(mut x: T) { |
| 177 | // Copy, partialeq, partialord |
| 178 | let _ = x; |
| 179 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd#gt(). T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.); |
| 180 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(x != T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.); |
| 181 | |
| 182 | // Operations |
| 183 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 184 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#sub().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 185 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#mul().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 186 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Div#div().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 187 | let _ = x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().%rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Rem#rem().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 188 | let _ = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#neg().x; |
| 189 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#add_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 190 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#sub_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 191 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#mul_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 192 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign()./=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/DivAssign#div_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 193 | x rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().%=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/RemAssign#rem_assign().T::ONErust-analyzer cargo lexical-util 1.0.7 num/Float#ONE.; |
| 194 | |
| 195 | // Check functions |
| 196 | let _ = x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().(); |
| 197 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(T::from_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#from_bits().(x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().()), x); |
| 198 | let _ = x.is_sign_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#is_sign_positive().(); |
| 199 | let _ = x.is_sign_negativerust-analyzer cargo lexical-util 1.0.7 num/Float#is_sign_negative().(); |
| 200 | let _ = x.lnrust-analyzer cargo lexical-util 1.0.7 num/Float#ln().(); |
| 201 | let _ = x.floorrust-analyzer cargo lexical-util 1.0.7 num/Float#floor().(); |
| 202 | |
| 203 | // Check properties |
| 204 | let _ = x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().T::SIGN_MASKrust-analyzer cargo lexical-util 1.0.7 num/Float#SIGN_MASK.; |
| 205 | let _ = x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().T::EXPONENT_MASKrust-analyzer cargo lexical-util 1.0.7 num/Float#EXPONENT_MASK.; |
| 206 | let _ = x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().T::HIDDEN_BIT_MASKrust-analyzer cargo lexical-util 1.0.7 num/Float#HIDDEN_BIT_MASK.; |
| 207 | let _ = x.to_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#to_bits().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/BitAnd#bitand().T::MANTISSA_MASKrust-analyzer cargo lexical-util 1.0.7 num/Float#MANTISSA_MASK.; |
| 208 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(T::from_bitsrust-analyzer cargo lexical-util 1.0.7 num/Float#from_bits().(T::INFINITY_BITSrust-analyzer cargo lexical-util 1.0.7 num/Float#INFINITY_BITS.).is_specialrust-analyzer cargo lexical-util 1.0.7 num/Float#is_special().()); |
| 209 | } |
| 210 | |
| 211 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 212 | #[cfg(any(feature = "parse-floats", feature = "write-floats"))] |
| 213 | fn float_testrust-analyzer cargo lexical-util 1.0.7 float_test().() { |
| 214 | use lexical_utilrust-analyzer cargo lexical-util 1.0.7 crate/::numrust-analyzer cargo lexical-util 1.0.7 num/::Floatrust-analyzer cargo lexical-util 1.0.7 num/Float#; |
| 215 | |
| 216 | check_floatrust-analyzer cargo lexical-util 1.0.7 check_float().(123f32); |
| 217 | check_floatrust-analyzer cargo lexical-util 1.0.7 check_float().(123f64); |
| 218 | |
| 219 | // b00000000000000000000000000000001 |
| 220 | let f: f32 = 1e-45; |
| 221 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 222 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 223 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 224 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 225 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 226 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 227 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().(), f); |
| 228 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().(), f); |
| 229 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().(), f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().()); |
| 230 | |
| 231 | // b00111101110011001100110011001101 |
| 232 | let f: f32 = 0.1; |
| 233 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 234 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 235 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 236 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 237 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 238 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 239 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().(), f); |
| 240 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().(), f); |
| 241 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().(), f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().()); |
| 242 | |
| 243 | // b01000000000000000000000000000000 |
| 244 | let f: f32 = 1.0; |
| 245 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 246 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().().is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 247 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().().is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 248 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 249 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().is_oddrust-analyzer cargo lexical-util 1.0.7 num/Float#is_odd().()); |
| 250 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().().is_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#is_even().()); |
| 251 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prevrust-analyzer cargo lexical-util 1.0.7 num/Float#prev().().nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().(), f); |
| 252 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(f.prev_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#prev_positive().().next_positiverust-analyzer cargo lexical-util 1.0.7 num/Float#next_positive().(), f); |
| 253 | assert_nerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_ne!!(f.round_positive_evenrust-analyzer cargo lexical-util 1.0.7 num/Float#round_positive_even().(), f.nextrust-analyzer cargo lexical-util 1.0.7 num/Float#next().()); |
| 254 | } |