concordium-rust-smart-contracts
concordium-rust-smart-contracts copied to clipboard
Investigate whether to add a fixed-point type
Task description
It might make sense to have a type to represent fixed-point fractional values and support calculations on it as part of concordium-std.
The design needs to be well thought-out to satisfy at least the following
- efficient at runtime. Fixed point computation are for the most part just computation with integers so we should not be needlessly wasteful.
- type safety
- correct and well-documented rounding behaviour. Failure should be explicit.
Sub-tasks
- [ ] Investigate the design space and make a proposal.
- [ ] Implement the API and test.
- [ ] Analyze performance, code size of generated code.