This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

A proper unit system

Currently, there is a small bit of code in recipes that knows just enough to recognize certain strings (such as "kg", "lbs" or "min") as units.

A proper unit system will handle:

We probably don't need to support the full dimension algebra (ie derive conversions for things like km/h -> m/s).

1. Details

Here is a step-by-step outline for how I envision this work to proceed.

  gboolean gr_unit_convert (GrNumber *in, GrUnit *from, GrUnit *to, GrNumber *out)

The boolean return value will be used to indicate when a conversion is not possible.

Updates (June 27):


2024-10-23 10:58