Skip to content

2025

Introducing absolute quantities

An absolute quantity is a quantity that represents a whole measurement of an entity (for example: a mass, a temperature on an absolute scale, or the total height of an object).

Unlike an affine point (which is defined relative to a named origin) or a delta (which represents a difference), an absolute quantity behaves like a delta for arithmetic (you can add and multiply it) while conceptually denoting a whole value without a user-specified origin. This makes many common physical expressions (summing masses, computing energies) more natural and less verbose.

We are considering making absolute quantities the default quantity abstraction in mp-units V3.

Bringing Quantity-Safety To The Next Level

All quantities and units libraries need to be unit-safe. Most of the libraries on the market do this correctly. Some of them are also dimension-safe, which adds another level of protection for their users.

mp-units is probably the only library on the market that additionally is quantity-safe. This gives a new quality and possibilities. I've described the major idea behind it, implementation details, and benefits to the users in the series of posts about the International System of Quantities.

However, this is only the beginning. We've always planned more and worked on the extensions in our free time. In this post, I will describe:

  • What a quantity character is?
  • The importance of using proper representation types for the quantities.
  • The power of providing character-specific operations for the quantities.
  • Discuss implementation challenges and possible solutions.