Re:Doing First Grade Math in Rust's Type System
by ReleaseCandidat on Saturday January 13, 2024 @05:35AM
(#38978740)
You do that (as nowadays in C++) with compile time "constants" https://doc.rust-lang.org/reference/const_eval.html
Re:Doing First Grade Math in Rust's Type System
by magicalhippo on Saturday January 13, 2024 @06:09AM
(#38978933)
Yes, but then you wouldn't be abusing the type system, so where's the fun in that? :P
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_rea...