Const casting between bnum types
Many of the functions in the crate are const, which is much appreciated. But I can not find a const way to cast between bnum types (for example, from a U1024 to a I256. Obviously the trait-based casting (As), which appears to be the primary approach, can't be const.
Does this feature already exist, and if not, can it be added?
Hi @darsor, right now bnum doesn't provide const casting functionality, for now you'd have to implement it yourself by copying the logic from the trait-based casting. However, when the next version is released, it will be much easier to perform const casting. I will comment with an update once this has been published.
Thanks for the quick response. I'll try copying the trait-based casting logic for now.