-
Notifications
You must be signed in to change notification settings - Fork 11
/
TODO.txt
99 lines (97 loc) · 4.61 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Floats:
* FromStr trait: REMEMBER: the num_traits crate has a general from_str_radix method for floats, could use if stuck
* Display, debug, upper exp, lower exp traits
* Transcendental functions:
* exp
* exp2
* exp_m1
* ln
* ln_1p
* log
* log2
* log10
* cbrt
* hypot
* sin
* cos
* tan
* asin
* acos
* atan
* atan2
* sin_cos
* sinh
* cosh
* tanh
* asinh
* acosh
* atanh
* to_degrees
* to_radians
* powf
* gamma
* ln_gamma
* Other functions:
* mul_add
* midpoint
* recip
* Optimised division algorithm depending on size of mantissa
* Optimised multiplication algorithm depending on size of mantissa
* Constants:
* DIGITS. For this, we can divide MB by f64::LOG2_10 and take floor (roughly speaking).
* MIN_10_EXP. For this, we can divide MIN_EXP by f64::LOG2_10, and take floor (roughly speaking)
* MAX_10_EXP. For this, we can divide MAX_EXP by f64::LOG2_10, and take floor (roughly speaking)
* Maths constants:
* E
* FRAC_1_PI
* FRAC_1_SQRT_2
* FRAC_2_PI
* FRAC_PI_2
* FRAC_PI_3
* FRAC_PI_4
* FRAC_PI_6
* FRAC_PI_8
* LN_2
* LN_10
* LOG2_10
* LOG2_E
* LOG10_2
* LOG10_E
* PI
* SQRT_2
* TAU
* FloatToInt trait
* From/TryFrom trait for ints, other floats
* Float type aliases from IEEE standard: f16, f32, f64, f80, f128. (Include f32 and f64 as allows const methods which aren't available on the primitives)
* Rand:
* gen_range stuff
* num_traits::{Bounded, Float, FloatConst, FloatCore, AsPrimitive, FromPrimitive, ToPrimitive, FromBytes, ToBytes, Inv, MulAdd, MulAddAssign, Pow, Signed, Euclid, Num}
* Division algorithm which doesn't need where clause
Ints:
* big idea: could only use u8 digits, but for calculations (would need to do this as BUintD8 is noticeably slower than BUint), use u64s or u128s, e.g. when iterating, iterate in batches of 8, use u64::from_ne_bytes/u64::from_le_bytes - this is a transmute so should be very small overhead (this might sacrifice some code readability)
* unsigned_signed_diff methods
* isqrt methods
* unbounded shr, shl methods
* Use new Rust const capabilities to write more idiomatic code (e.g. we don't need the option_expect! macro anymore). Note though that maybe we should wait a bit to keep the MSRV not too recent
* Faster mulitplication algorithm for larger integers
* Faster division algorithms for larger integers
* Update serde to use decimal string instead of struct debug - but CHECK that all serde options serialise primitive ints as decimal strings
* FromBytes and ToBytes num_traits traits - only when can implement without "unconstrained generic constant" error
* do we need the from_be_slice and from_le_slice methods? (think we can just call from_radix_{b, l}e with radix 256)
* create more efficient implementation of ilog10 (see e.g. Hacker's Delight book)
Other stuff:
* Think about removing BTryFrom and just implementing TryFrom (no From for now), then can use CastFrom/As trait for Result-less conversions
* Replace bitors, bitands, shifts, masks etc. with more efficient implementations (e.g. using set_bit, flip_bit, one-less-than-power-of-two methods, methods for efficiently generating masks/getting certain range of bits of integer)
* Consider putting floats and signed integers behind optional features (which are enabled by default)
* Add 16 bit and 32 bit width types to the test widths, so test u16, u32, f16, f32 as well (just make the digit sizes that are too wide not do anything for those tests)
* Consider removing implementation of AsPrimitive<BUint> for primitive ints
* Consider removing Add<Digit> and Div<Digit> impls
* Rewrite README
* consider removing parse_str_radix method, not really necessary now Option::expect and unwrap are const
* consider raising issue in num_traits crate about PrimInt dependency on NumCast
* consider using Rust's ParseIntError and TryFromIntError instead of own types, would have to do this by deliberating doing a calculation resulting in error (e.g. u8::from_str_radix(" ", 10)). this might be not be very good practice though, and would have to do for ParseFloatError eventually as well, which could be trickier to do this way
* consider splitting off allow-based methods into gated "alloc" feature
* work out and add assertions about sizes of e.g. int widths (should be <= u32::MAX), and float mantissa and exponent widths, etc.
* include list of difference with primitives in README, e.g. overflow_checks not detected yet, serde implementation different, memory layout different (always little endian - although maybe this could be changed? probably not a good idea though)
* test using stable, only use nightly when need to test be_bytes methods
* check you're happy with the layout of the random crate-level module