mp-units icon indicating copy to clipboard operation
mp-units copied to clipboard

Ensure `value_cast<QP>` uses the minimum number of operataions needed

Open burnpanck opened this issue 1 year ago • 3 comments

This PR is supposed to continue from the discussion here, where value_cast<QP> was introduced.

Basically, value_cast<QP> does three steps:

  1. Convert the representation/unit of the input quantity_point to an intermediate representation, not touching the origin
  2. Change the origin by adding a suitable offset
  3. Convert the representation/unit of the intermediate quantity_point to the final representation.

However, in the current implementation, the second step (change of origin) may in fact introduce more representation conversions internally: to a common representation between the offset and the value. However, here, that is not necessary, because the representation of the value is already chosen suitably.

burnpanck avatar Jul 20 '24 08:07 burnpanck

@burnpanck, I fixed all the CI issues today. If you could rebase to master, we would see this change's real CI status.

mpusz avatar Jul 29 '24 17:07 mpusz

@burnpanck, do you still plan to work on your PRs?

mpusz avatar Sep 06 '24 16:09 mpusz

Hi @burnpanck! Do you plan to work on those in the near future. I plan to release mp-units 2.3 soon.

mpusz avatar Sep 13 '24 08:09 mpusz