concordium-rust-smart-contracts icon indicating copy to clipboard operation
concordium-rust-smart-contracts copied to clipboard

Investigate whether to add a fixed-point type

Open abizjak opened this issue 4 years ago • 0 comments

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.

abizjak avatar May 06 '21 05:05 abizjak