4 ms·
I needed 128-bit and 256-bit integers on an embedded project recently. In short, it was for fixed-point digital signal processing. The raw input and output sam
by ooterness 3y ago
I needed 128-bit and 256-bit integers on an embedded project recently.
In short, it was for fixed-point digital signal processing. The raw input and output samples were int64_t. We needed to add, subtract, multiply, and accumulate these to do filtering and linear regression with no loss of precision.
Conventional bigintegers weren't an option because the target application doesn't allow heap allocation. So we rolled our own [1] stack-allocated, fixed-width big integer class.
[1] https://github.com/the-aerospace-corporation/satcat5/blob/main/src/cpp/satcat5/wide_integer.h https://github.com/the-aerospace-corporation/satcat5/blob/ma...
- fluoridation 3y agoWas there a reason not to use boost::multiprecision?
- ooterness 3y agoIn this case, the target platform has 256 kiB of RAM, no hardware floating point, and no operating system. I could be wrong, but Boost did not look like a good fit.