MCPcopy Create free account

hub / github.com/WuBingzheng/primitive_fixed_point_decimal / functions

Functions175 in github.com/WuBingzheng/primitive_fixed_point_decimal

↓ 54 callersFunctiondo_test_format
(s: &str, scale: i32, n: I)
src/fpdec_inner.rs:503
↓ 39 callersFunctiondo_test_format_num_only
(n: I)
src/fpdec_inner.rs:519
↓ 26 callersMethodcalc_mul_div
(self, b: Self, c: Self, rounding: Rounding)
src/inner_i128.rs:73
↓ 17 callersFunctioncheck_calc_mul_div_signs
(a: i128, b: i128, c: i128)
src/inner_i128.rs:592
↓ 15 callersFunctioncheck_calc_mul_div_unsigned
(a: u128, b: u128, c: u128)
src/inner_i128.rs:667
↓ 13 callersMethodchecked_mul
( self, rhs: OobScaleFpdec<J>, diff_scale: i32, // scale (self + rhs - result) )
src/oob_scale_fpdec.rs:46
↓ 13 callersFunctiondo_check_fmt
(f: f64)
src/const_scale_fpdec.rs:976
↓ 12 callersMethodcalc_mul_div_exp
(self, b: Self, i: usize, rounding: Rounding)
src/inner_shorts.rs:126
↓ 12 callersMethodcalc_mul_div_exp
(self, b: Self, i: usize, rounding: Rounding)
src/inner_i128.rs:113
↓ 12 callersMethodunsigned_abs
(self)
src/inner_i128.rs:14
↓ 11 callersFunctionmul2
calculate: a * b = (mhigh,mlow)
src/inner_i128.rs:291
↓ 7 callersMethodchecked_div
( self, rhs: OobScaleFpdec<J>, diff_scale: i32, // scale (self - rhs - result) )
src/oob_scale_fpdec.rs:158
↓ 7 callersFunctiondump_single
dump a single integer number This is much faster than using integers' Display.
src/fpdec_inner.rs:445
↓ 6 callersMethodrounding_div
Calculate rounding division. Examples: ``` use primitive_fixed_point_decimal::{FpdecInner, Rounding}; assert_eq!(8.rounding_div(3, Rounding::Floor),
src/fpdec_inner.rs:137
↓ 5 callersFunctiondump_decimal
dump: "int . frac"
src/fpdec_inner.rs:429
↓ 4 callersFunctioncheck_calc_mul_div
(a: i128, b: i128, c: i128)
src/inner_i128.rs:567
↓ 4 callersFunctiondo_test_rounding_div_big
(a: i32, b: i32)
src/fpdec_inner.rs:760
↓ 4 callersFunctiondo_test_rounding_div_big4
(a: i32, b: i32)
src/fpdec_inner.rs:768
↓ 4 callersFunctiondo_test_rounding_div_small
(a: i32, b: i32)
src/fpdec_inner.rs:733
↓ 4 callersFunctiondo_test_rounding_div_small4
(a: i32, b: i32)
src/fpdec_inner.rs:741
↓ 4 callersFunctionpad_zeros
(n: usize, buf: &mut [MaybeUninit<u8>])
src/fpdec_inner.rs:479
↓ 4 callersMethodrounding_div
(self, b: Self, rounding: Rounding)
src/inner_i128.rs:153
↓ 4 callersFunctionrust_add
(a: RustDec, b: RustDec)
benches/vs_rust_decimal.rs:131
↓ 3 callersMethodas_str
(&self)
src/const_scale_fpdec.rs:958
↓ 3 callersMethodas_wider
(self)
src/inner_i128.rs:20
↓ 3 callersFunctionassert_big_128
(n: i128, ti: u32)
fuzz/fuzz_targets/self_proof.rs:144
↓ 3 callersFunctionassert_big_64
(n: i64, ti: u32)
fuzz/fuzz_targets/self_proof.rs:147
↓ 3 callersMethoddisplay_fmt
(self, scale: i32, f: &mut fmt::Formatter)
src/fpdec_inner.rs:285
↓ 3 callersFunctiondiv_exp_fast_2word
calculate fast: n / exp, with i = log10(exp) n is 2-word, 128-bit, double of divisor(exp). Use the algorithm in Moller and Granlund's paper: Improve
src/inner_shorts.rs:260
↓ 3 callersFunctiondiv_exp_fast_2word
calculate fast: (n1 * n2 + extra) / exp, with i = log10(exp) divident is 2-word, 256-bit, double of divisor(exp). Use the algorithm in Moller and Gr
src/inner_i128.rs:399
↓ 3 callersMethoddo_rounding_div
(self, b: Self, rounding: Rounding)
src/fpdec_inner.rs:141
↓ 3 callersFunctiondo_test_calc_mul_div
(a: u64, b: u64, exp: u64, iexp: usize)
src/inner_shorts.rs:371
↓ 3 callersFunctiondo_test_calc_mul_div
(a: u128, b: u128, exp: u128, iexp: usize)
src/inner_i128.rs:747
↓ 3 callersFunctiondo_test_calc_mul_div_signed
(a: i64, b: i64, exp: i64, iexp: usize)
src/inner_shorts.rs:383
↓ 3 callersFunctiondo_test_calc_mul_div_signed
(a: i128, b: i128, exp: i128, iexp: usize)
src/inner_i128.rs:759
↓ 3 callersFunctiondo_test_rounding_div_no_rem
(a: i32, b: i32)
src/fpdec_inner.rs:714
↓ 2 callersFunctionbench_dump
(c: &mut Criterion, name: &str, input: &str)
benches/vs_rust_decimal.rs:404
↓ 2 callersFunctionbench_load
(c: &mut Criterion, name: &str, input: &str)
benches/vs_rust_decimal.rs:390
↓ 2 callersMethodcalc_mul_div
Calculate `self * b / c`. Since i128 and u128 do not have wider types, then have their own implementations.
src/fpdec_inner.rs:49
↓ 2 callersMethodchecked_div_ext
( self, rhs: OobScaleFpdec<J>, diff_scale: i32, // scale (self - rhs - result)
src/oob_scale_fpdec.rs:194
↓ 2 callersMethodchecked_mul_ext
( self, rhs: OobScaleFpdec<J>, diff_scale: i32, // scale (self + rhs - result)
src/oob_scale_fpdec.rs:87
↓ 2 callersFunctiondiv_exp_fast_1word
calculate fast: n / 10.pow(i) n is 1-word, 64-bit, same with divisor(exp). Use the algorithm in Granlund & Montgomery's paper: https://gmplib.org/%7
src/inner_shorts.rs:332
↓ 2 callersFunctiondiv_exp_fast_1word
calculate fast: n / 10.pow(i) n is 1-word, 128-bit, same with divisor(exp). Use the algorithm in Granlund & Montgomery's paper: https://gmplib.org/%
src/inner_i128.rs:502
↓ 2 callersFunctionprim128_mul_rescale
(a: PrimDec128, b: PrimDec128)
benches/vs_rust_decimal.rs:75
↓ 2 callersFunctionprim64_mul_rescale
(a: PrimDec64, b: PrimDec64)
benches/vs_rust_decimal.rs:16
↓ 2 callersFunctionreduce2
reduce: (mhigh, mlow) into (last_dividend, q) where last_dividend fits in 128-bit. calculate: (mhigh,mlow) / divisor = q .. last_dividend where last_
src/inner_i128.rs:306
↓ 2 callersMethodround_diff_with_rounding
diff_scale = scale (src - dst)
src/fpdec_inner.rs:106
↓ 2 callersFunctionrust_div
(a: RustDec, b: RustDec)
benches/vs_rust_decimal.rs:137
↓ 2 callersFunctionrust_mul
(a: RustDec, b: RustDec)
benches/vs_rust_decimal.rs:134
↓ 1 callersFunctionbench_add
(c: &mut Criterion)
benches/vs_rust_decimal.rs:210
↓ 1 callersFunctionbench_app
(c: &mut Criterion)
benches/vs_rust_decimal.rs:429
↓ 1 callersFunctionbench_div_pure
(c: &mut Criterion)
benches/vs_rust_decimal.rs:332
↓ 1 callersFunctionbench_div_rescale
(c: &mut Criterion)
benches/vs_rust_decimal.rs:361
↓ 1 callersFunctionbench_mul_pure
(c: &mut Criterion)
benches/vs_rust_decimal.rs:250
↓ 1 callersFunctionbench_mul_rescale
(c: &mut Criterion)
benches/vs_rust_decimal.rs:278
↓ 1 callersFunctionbench_mul_rescale_big
(c: &mut Criterion)
benches/vs_rust_decimal.rs:299
↓ 1 callersMethodcalc_mul_div_exp
Calculate `self * b / EXP[i]`. i64, u64, i128, u128 have their own implemetations to avoid the expensive 128-bit division.
src/fpdec_inner.rs:58
↓ 1 callersMethodchecked_div
( self, rhs: ConstScaleFpdec<J, S2>, )
src/const_scale_fpdec.rs:105
↓ 1 callersMethodchecked_div_const_scale
( self, rhs: ConstScaleFpdec<J, S>, )
src/oob_scale_fpdec.rs:215
↓ 1 callersMethodchecked_div_const_scale_ext
( self, rhs: ConstScaleFpdec<J, S>, rounding: Rounding, )
src/oob_scale_fpdec.rs:247
↓ 1 callersMethodchecked_div_ext
( self, rhs: ConstScaleFpdec<J, S2>, rounding: Rounding, )
src/const_scale_fpdec.rs:139
↓ 1 callersMethodchecked_mul
( self, rhs: ConstScaleFpdec<J, S2>, )
src/const_scale_fpdec.rs:44
↓ 1 callersMethodchecked_mul_const_scale
( self, rhs: ConstScaleFpdec<J, S>, )
src/oob_scale_fpdec.rs:107
↓ 1 callersMethodchecked_mul_const_scale_ext
( self, rhs: ConstScaleFpdec<J, S>, rounding: Rounding, )
src/oob_scale_fpdec.rs:141
↓ 1 callersMethodchecked_mul_ext
( self, rhs: ConstScaleFpdec<J, S2>, rounding: Rounding, )
src/const_scale_fpdec.rs:84
↓ 1 callersFunctiondisplay_num
We assume the number is non-negative here. The caller should handle the sign.
src/fpdec_inner.rs:322
↓ 1 callersFunctionprim128_add
(a: PrimDec128, b: PrimDec128)
benches/vs_rust_decimal.rs:72
↓ 1 callersFunctionprim128_app
(ctx: &Prim128AppContext, amount: PrimDec128, price: PrimPrice)
benches/vs_rust_decimal.rs:107
↓ 1 callersFunctionprim128_div_pure
(a: PrimDec128, b: PrimDec128)
benches/vs_rust_decimal.rs:84
↓ 1 callersFunctionprim128_div_rescale
(a: PrimDec128, b: PrimDec128)
benches/vs_rust_decimal.rs:81
↓ 1 callersFunctionprim128_dump
(a: PrimDec128, buf: &mut String)
benches/vs_rust_decimal.rs:90
↓ 1 callersFunctionprim128_load
(s: &str)
benches/vs_rust_decimal.rs:87
↓ 1 callersFunctionprim128_mul_pure
(a: PrimDec128, b: PrimDec128)
benches/vs_rust_decimal.rs:78
↓ 1 callersFunctionprim64_add
(a: PrimDec64, b: PrimDec64)
benches/vs_rust_decimal.rs:13
↓ 1 callersFunctionprim64_app
(ctx: &Prim64AppContext, amount: PrimDec64, price: PrimPrice)
benches/vs_rust_decimal.rs:48
↓ 1 callersFunctionprim64_div_pure
(a: PrimDec64, b: PrimDec64)
benches/vs_rust_decimal.rs:25
↓ 1 callersFunctionprim64_div_rescale
(a: PrimDec64, b: PrimDec64)
benches/vs_rust_decimal.rs:22
↓ 1 callersFunctionprim64_dump
(a: PrimDec64, buf: &mut String)
benches/vs_rust_decimal.rs:31
↓ 1 callersFunctionprim64_load
(s: &str)
benches/vs_rust_decimal.rs:28
↓ 1 callersFunctionprim64_mul_pure
(a: PrimDec64, b: PrimDec64)
benches/vs_rust_decimal.rs:19
↓ 1 callersFunctionreduce2_big
(mhigh: u128, mlow: u128, divisor: u128)
src/inner_i128.rs:343
↓ 1 callersMethodrescale
Convert to OobScaleFpdec with scale specified. Return error if overflow occurred (to bigger scale) or precision lost (to smaller scale). Examples:
src/oob_scale_fpdec.rs:789
↓ 1 callersMethodround_diff_ext
(self, diff_scale: i32, rounding: Rounding)
src/oob_scale_fpdec.rs:288
↓ 1 callersMethodround_ext
(self, scale: i32, rounding: Rounding)
src/const_scale_fpdec.rs:177
↓ 1 callersFunctionrust_app
(ctx: &RustAppContext, amount: RustDec, price: RustDec)
benches/vs_rust_decimal.rs:160
↓ 1 callersFunctionrust_dump
(a: RustDec, buf: &mut String)
benches/vs_rust_decimal.rs:143
↓ 1 callersFunctionrust_load
(s: &str)
benches/vs_rust_decimal.rs:140
↓ 1 callersMethodsum
(iter: Iter)
src/const_scale_fpdec.rs:601
↓ 1 callersMethodsum
(iter: Iter)
src/oob_scale_fpdec.rs:652
FunctionFmt32
(d: Dec32, s: i32)
src/oob_scale_fpdec.rs:886
Function_bench_int
(c: &mut Criterion)
benches/vs_rust_decimal.rs:182
Methodadd
(self, rhs: Self)
src/const_scale_fpdec.rs:422
Methodadd
(self, rhs: Self)
src/oob_scale_fpdec.rs:508
Methodadd_assign
(&mut self, rhs: Self)
src/const_scale_fpdec.rs:541
Methodadd_assign
(&mut self, rhs: Self)
src/oob_scale_fpdec.rs:594
Methodchecked_div_ext
works only when: diff_scale in range [-Self::DIGITS, Self::DIGITS] diff_scale = scale (self + rhs - result)
src/fpdec_inner.rs:85
Methodchecked_from_int
(self, scale: i32)
src/fpdec_inner.rs:305
Methodchecked_mul_ext
works only when: diff_scale in range [-Self::DIGITS, Self::DIGITS] diff_scale = scale (self + rhs - result)
src/fpdec_inner.rs:64
Functioncriterion_benchmark
entry
benches/vs_rust_decimal.rs:488
Methoddeserialize
(deserializer: D)
src/const_scale_fpdec.rs:650
next →1–100 of 175, ranked by callers