| 1 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::{selfrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#}; |
| 2 | |
| 3 | use craterust-analyzer cargo fast-float2 0.2.3 crate/::commonrust-analyzer cargo fast-float2 0.2.3 common/::{is_8digitsrust-analyzer cargo fast-float2 0.2.3 common/is_8digits()., parse_digitsrust-analyzer cargo fast-float2 0.2.3 common/parse_digits()., ByteSlicerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#}; |
| 4 | |
| 5 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)] |
| 6 | pub struct Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 7 | pub num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.: usize, |
| 8 | pub decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point.: i32, |
| 9 | pub negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative.: bool, |
| 10 | pub truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated.: bool, |
| 11 | pub digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.: [u8; Selfrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::MAX_DIGITS], |
| 12 | } |
| 13 | |
| 14 | impl Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 15 | fn fmtrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Debug]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# { |
| 16 | f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Decimal") |
| 17 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("num_digits", &self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.) |
| 18 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("decimal_point", &self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point.) |
| 19 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("negative", &self.negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative.) |
| 20 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("truncated", &self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated.) |
| 21 | .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("digits", &(&self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().)) |
| 22 | .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().() |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 27 | fn eqrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][`PartialEq<Self>`]eq().(&self, other: &Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][`PartialEq<Self>`]) -> bool { |
| 28 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().other.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. |
| 29 | && self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialEq<Self>`]eq().other.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. |
| 30 | && self.negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq().other.negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative. |
| 31 | && self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[bool][`PartialEq<Self>`]eq().other.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. |
| 32 | && self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/cmp/impl#[`[T]`][`PartialEq<[U]>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/cmp/impl#[`[T]`][`PartialEq<[U]>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/cmp/impl#[`[T]`][`PartialEq<[U]>`]eq().other.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | impl Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq# for Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 37 | } |
| 38 | |
| 39 | impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 40 | fn defaultrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Default]default().() -> Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Default] { |
| 41 | Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Default] { |
| 42 | num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.: 0, |
| 43 | decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point.: 0, |
| 44 | negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative.: false, |
| 45 | truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated.: false, |
| 46 | digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.: [0; Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Default]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS.], |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | impl Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 52 | pub const MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS.: usize = 768; |
| 53 | pub const MAX_DIGITS_WITHOUT_OVERFLOWrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS_WITHOUT_OVERFLOW.: usize = 19; |
| 54 | pub const DECIMAL_POINT_RANGErust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]DECIMAL_POINT_RANGE.: i32 = 2047; |
| 55 | |
| 56 | #[inline] |
| 57 | pub fn try_add_digitrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]try_add_digit().(&mut self, digit: u8) { |
| 58 | if self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 59 | self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = digit; |
| 60 | } |
| 61 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 62 | } |
| 63 | |
| 64 | #[inline] |
| 65 | pub fn trimrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]trim().(&mut self) { |
| 66 | while self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 && self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().0 { |
| 67 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | #[inline] |
| 72 | pub fn roundrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]round().(&self) -> u64 { |
| 73 | if self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 || self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0 { |
| 74 | return 0; |
| 75 | } else if self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]gt().18 { |
| 76 | return 0xFFFF_FFFF_FFFF_FFFF_u64; |
| 77 | } |
| 78 | let dp = self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. as usize; |
| 79 | let mut n = 0_u64; |
| 80 | for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#dp { |
| 81 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign().10; |
| 82 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 83 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as u64; |
| 84 | } |
| 85 | } |
| 86 | let mut round_up = false; |
| 87 | if dp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 88 | round_up = self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().dp]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]ge().5; |
| 89 | if self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().dp]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().5 && dp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 90 | round_up = self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. || ((dp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0) && (1 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u8][`BitAnd<Self>`]bitand().self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().dp rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().0)); |
| 91 | } |
| 92 | } |
| 93 | if round_up { |
| 94 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().1; |
| 95 | } |
| 96 | n |
| 97 | } |
| 98 | |
| 99 | #[inline] |
| 100 | pub fn left_shiftrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]left_shift().(&mut self, shift: usize) { |
| 101 | if self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 102 | return; |
| 103 | } |
| 104 | let num_new_digits = number_of_digits_decimal_left_shiftrust-analyzer cargo fast-float2 0.2.3 decimal/number_of_digits_decimal_left_shift().(self, shift); |
| 105 | let mut read_index = self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits.; |
| 106 | let mut write_index = self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().num_new_digits; |
| 107 | let mut n = 0_u64; |
| 108 | while read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 109 | read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 110 | write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 111 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`AddAssign<Self>`]add_assign().(self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().read_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as u64) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl().shift; |
| 112 | let quotient = n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().10; |
| 113 | let remainder = n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().(10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().quotient); |
| 114 | if write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 115 | self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().write_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = remainder as u8; |
| 116 | } else if remainder rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 117 | self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. = true; |
| 118 | } |
| 119 | n = quotient; |
| 120 | } |
| 121 | while n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 122 | write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().1; |
| 123 | let quotient = n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Div<Self>`]div().10; |
| 124 | let remainder = n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().(10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().quotient); |
| 125 | if write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 126 | self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().write_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = remainder as u8; |
| 127 | } else if remainder rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 128 | self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. = true; |
| 129 | } |
| 130 | n = quotient; |
| 131 | } |
| 132 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().num_new_digits; |
| 133 | if self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 134 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. = Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS.; |
| 135 | } |
| 136 | self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().num_new_digits as i32; |
| 137 | self.trimrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]trim().(); |
| 138 | } |
| 139 | |
| 140 | #[inline] |
| 141 | pub fn right_shiftrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]right_shift().(&mut self, shift: usize) { |
| 142 | let mut read_index = 0; |
| 143 | let mut write_index = 0; |
| 144 | let mut n = 0_u64; |
| 145 | while (n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 { |
| 146 | if read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 147 | n = (10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().n) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().read_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as u64; |
| 148 | read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 149 | } else if n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 { |
| 150 | return; |
| 151 | } else { |
| 152 | while (n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialEq<Self>`]eq().0 { |
| 153 | n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign().*=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`MulAssign<Self>`]mul_assign().10; |
| 154 | read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 155 | } |
| 156 | break; |
| 157 | } |
| 158 | } |
| 159 | self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`SubAssign<Self>`]sub_assign().read_index as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().1; |
| 160 | if self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::DECIMAL_POINT_RANGErust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]DECIMAL_POINT_RANGE. { |
| 161 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. = 0; |
| 162 | self.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. = 0; |
| 163 | self.negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative. = false; |
| 164 | self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. = false; |
| 165 | return; |
| 166 | } |
| 167 | let mask = (1_u64 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl().<<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shl<usize>`]shl().shift) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().1; |
| 168 | while read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 169 | let new_digit = (n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().shift) as u8; |
| 170 | n = (10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().(n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand().mask)) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Add<Self>`]add().self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().read_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). as u64; |
| 171 | read_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 172 | self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().write_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = new_digit; |
| 173 | write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 174 | } |
| 175 | while n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().0 { |
| 176 | let new_digit = (n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`Shr<usize>`]shr().shift) as u8; |
| 177 | n = 10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Mul<Self>`]mul().(n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u64][`BitAnd<Self>`]bitand().mask); |
| 178 | if write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().Selfrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 179 | self.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().write_index]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = new_digit; |
| 180 | write_index rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 181 | } else if new_digit rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]gt().0 { |
| 182 | self.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. = true; |
| 183 | } |
| 184 | } |
| 185 | self.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. = write_index; |
| 186 | self.trimrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]trim().(); |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | #[inline] |
| 191 | pub fn parse_decimalrust-analyzer cargo fast-float2 0.2.3 decimal/parse_decimal().(mut s: &[u8]) -> Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal# { |
| 192 | // can't fail since it follows a call to parse_number |
| 193 | assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().s.is_emptyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]is_empty().(), "the buffer cannot be empty since it follows a call to parse_number"); |
| 194 | let mut d = Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::defaultrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal][Default]default().(); |
| 195 | let start = s; |
| 196 | |
| 197 | let c = s[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().; |
| 198 | d.negativerust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#negative. = c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'-'; |
| 199 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'-' || c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'+' { |
| 200 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(1); |
| 201 | } |
| 202 | s = s.skip_charsrust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#skip_chars().(b'0'); |
| 203 | parse_digitsrust-analyzer cargo fast-float2 0.2.3 common/parse_digits().(&mut s, |digit| d.try_add_digitrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]try_add_digit().(digit)); |
| 204 | if s.check_firstrust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#check_first().(b'.') { |
| 205 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(1); |
| 206 | let first = s; |
| 207 | if d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().0 { |
| 208 | s = s.skip_charsrust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#skip_chars().(b'0'); |
| 209 | } |
| 210 | while s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().8 && d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().8 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt().Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 211 | // SAFETY: Safe since `s.len() >= 8` |
| 212 | let v = unsafe { s.read_u64rust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#read_u64().() }; |
| 213 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().is_8digitsrust-analyzer cargo fast-float2 0.2.3 common/is_8digits().(v) { |
| 214 | break; |
| 215 | } |
| 216 | // SAFETY: Safe since `num_digits + 8 < Decimal::MAX_DIGITS` |
| 217 | unsafe { d.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut()..write_u64rust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#write_u64().(v rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u64][`Sub<Self>`]sub().0x3030_3030_3030_3030) }; |
| 218 | d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().8; |
| 219 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(8); |
| 220 | } |
| 221 | parse_digitsrust-analyzer cargo fast-float2 0.2.3 common/parse_digits().(&mut s, |digit| d.try_add_digitrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]try_add_digit().(digit)); |
| 222 | d.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. = s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as i32 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Sub<Self>`]sub().first.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as i32; |
| 223 | } |
| 224 | if d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]ne().0 { |
| 225 | // Ignore the trailing zeros if there are any |
| 226 | let mut n_trailing_zeros = 0; |
| 227 | for &c in start[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#(start.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().s.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().())]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().revrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#rev().() { |
| 228 | if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().b'0' { |
| 229 | n_trailing_zeros rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1; |
| 230 | } else if c rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().b'.' { |
| 231 | break; |
| 232 | } |
| 233 | } |
| 234 | d.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().n_trailing_zeros as i32; |
| 235 | d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().-=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`SubAssign<Self>`]sub_assign().n_trailing_zeros; |
| 236 | d.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. as i32; |
| 237 | if d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS. { |
| 238 | d.truncatedrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#truncated. = true; |
| 239 | d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. = Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::MAX_DIGITSrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS.; |
| 240 | } |
| 241 | } |
| 242 | if s.check_first2rust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#check_first2().(b'e', b'E') { |
| 243 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(1); |
| 244 | let mut neg_exp = false; |
| 245 | if s.check_firstrust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#check_first().(b'-') { |
| 246 | neg_exp = true; |
| 247 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(1); |
| 248 | } else if s.check_firstrust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#check_first().(b'+') { |
| 249 | s = s.advancerust-analyzer cargo fast-float2 0.2.3 common/ByteSlice#advance().(1); |
| 250 | } |
| 251 | let mut exp_num = 0_i32; |
| 252 | parse_digitsrust-analyzer cargo fast-float2 0.2.3 common/parse_digits().(&mut s, |digit| { |
| 253 | if exp_num rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[i32][`PartialOrd<Self>`]lt().0x10000 { |
| 254 | exp_num = 10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Mul<Self>`]mul().exp_num rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`Add<Self>`]add().digit as i32; |
| 255 | } |
| 256 | }); |
| 257 | d.decimal_pointrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#decimal_point. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][`AddAssign<Self>`]add_assign().if neg_exp { |
| 258 | -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().exp_num |
| 259 | } else { |
| 260 | exp_num |
| 261 | }; |
| 262 | } |
| 263 | for i in d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#::MAX_DIGITS_WITHOUT_OVERFLOWrust-analyzer cargo fast-float2 0.2.3 decimal/impl#[Decimal]MAX_DIGITS_WITHOUT_OVERFLOW. { |
| 264 | d.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = 0; |
| 265 | } |
| 266 | d |
| 267 | } |
| 268 | |
| 269 | #[inline] |
| 270 | #[allow(clippy::redundant_else)] |
| 271 | fn number_of_digits_decimal_left_shiftrust-analyzer cargo fast-float2 0.2.3 decimal/number_of_digits_decimal_left_shift().(d: &Decimalrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#, mut shift: usize) -> usize { |
| 272 | const TABLErust-analyzer cargo fast-float2 0.2.3 decimal/TABLE.: [u16; 65] = [ |
| 273 | 0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817, 0x181D, 0x2024, |
| 274 | 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067, 0x3073, 0x3080, 0x388E, 0x389C, |
| 275 | 0x38AB, 0x38BB, 0x40CC, 0x40DD, 0x40EF, 0x4902, 0x4915, 0x4929, 0x513E, 0x5153, 0x5169, |
| 276 | 0x5180, 0x5998, 0x59B0, 0x59C9, 0x61E3, 0x61FD, 0x6218, 0x6A34, 0x6A50, 0x6A6D, 0x6A8B, |
| 277 | 0x72AA, 0x72C9, 0x72E9, 0x7B0A, 0x7B2B, 0x7B4D, 0x8370, 0x8393, 0x83B7, 0x83DC, 0x8C02, |
| 278 | 0x8C28, 0x8C4F, 0x9477, 0x949F, 0x94C8, 0x9CF2, 0x051C, 0x051C, 0x051C, 0x051C, |
| 279 | ]; |
| 280 | const TABLE_POW5rust-analyzer cargo fast-float2 0.2.3 decimal/TABLE_POW5.: [u8; 0x051C] = [ |
| 281 | 5, 2, 5, 1, 2, 5, 6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 7, 9, 8, 8, 4, 0, 3, 5, 4, 7, 2, 0, 5, 9, 6, 2, |
| 324 | 2, 4, 0, 6, 9, 5, 9, 5, 3, 3, 6, 9, 1, 4, 0, 6, 2, 5, |
| 325 | ]; |
| 326 | |
| 327 | shift rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAndAssign<Self>`]bitand_assign().&=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAndAssign<Self>`]bitand_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[usize][`BitAndAssign<Self>`]bitand_assign().63; |
| 328 | let x_a = TABLErust-analyzer cargo fast-float2 0.2.3 decimal/TABLE.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().shift]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 329 | let x_b = TABLErust-analyzer cargo fast-float2 0.2.3 decimal/TABLE.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().shift rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 330 | let num_new_digits = (x_a rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().11) as usize; |
| 331 | let pow5_a = (0x7FF rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().x_a) as usize; |
| 332 | let pow5_b = (0x7FF rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().&rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`BitAnd<Self>`]bitand().x_b) as usize; |
| 333 | let pow5 = &TABLE_POW5rust-analyzer cargo fast-float2 0.2.3 decimal/TABLE_POW5.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().pow5_a..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().; |
| 334 | for (i, &p5) in pow5.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().().takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#take().(pow5_b rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().pow5_a) { |
| 335 | if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().>=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]ge().d.num_digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#num_digits. { |
| 336 | return num_new_digits rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 337 | } else if d.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().p5 { |
| 338 | continue; |
| 339 | } else if d.digitsrust-analyzer cargo fast-float2 0.2.3 decimal/Decimal#digits.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().i]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().<rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialOrd<Self>`]lt().p5 { |
| 340 | return num_new_digits rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1; |
| 341 | } else { |
| 342 | return num_new_digits; |
| 343 | } |
| 344 | } |
| 345 | num_new_digits |
| 346 | } |