3 ms·
While not nearly as involved, I've seen similar-ish techniques used for FFTs and similar algorithms, in order to precompute constants. Here[1] is an example in
by magicalhippo 3y ago
While not nearly as involved, I've seen similar-ish techniques used for FFTs and similar algorithms, in order to precompute constants.
Here[1] is an example in C++ but given the article it seems you could do something similar in Rust.
[1]: https://github.com/tmolteno/template-fft/blob/master/fft_real.h https://github.com/tmolteno/template-fft/blob/master/fft_rea...
- ReleaseCandidat 3y agoYou do that (as nowadays in C++) with compile time "constants" https://doc.rust-lang.org/reference/const_eval.html https://doc.rust-lang.org/reference/const_eval.html
- magicalhippo 3y agoYes, but then you wouldn't be abusing the type system, so where's the fun in that? :P