openage icon indicating copy to clipboard operation
openage copied to clipboard

Fixed point intermediary type

Open heinezen opened this issue 2 years ago • 3 comments

Required Skills: C++

Difficulty: Medium

We could use an optional intermediary type for fixed-point types. Intermediary types are used for temporary values in calculations where intermediary steps can cause the original values to overflow. A common scenario where this can happen are multiplication or division. We take inspiration for this from the fpm library.

Intermediary types are only strictly necessary if the base type is small, e.g. int16_t. Therefore, their usage should be optional.

Tasks

  • [ ] Add intermediary type as optional template parameter
  • [ ] Use intermediary type in fixed-point calculations

Further Reading

heinezen avatar Sep 17 '23 16:09 heinezen

@ArcXeon Sure, go ahead :)

heinezen avatar Sep 26 '23 18:09 heinezen

Hey, I'd like to give this a shot. Thanks!

Pranshu-S avatar Mar 04 '24 06:03 Pranshu-S

@Pranshu-S go for it :)

heinezen avatar Mar 06 '24 22:03 heinezen