MadsKirkFoged / EngineeringUnits

Working with units made easy with automatic unit-check and converting between units
MIT License
41 stars 10 forks source link

Dimensionless base unit #3

Closed wiwalsh closed 3 years ago

wiwalsh commented 3 years ago

This is some demo code to add DimensionlessUnit and also an implicit conversion between DimensionlessUnit and double.

The DimensionlessUnit seems to work, but implicit conversion does not yet work. I believe this is because it first needs to be converted from UnknownUnit back to DimensionlessUnit to have access to the implicit conversion (But I don't know how to do this, and even if I did it probably wouldn't compile).

Many suggestions welcome

wiwalsh commented 3 years ago

Obviously not quite ready to merge....Wanted to get some review and comments.

wiwalsh commented 3 years ago

Closing. The root issue that this PR was attempting to address has been solved in main. Dimensionless may be interesting to add at a later date, but I don't have a use case at the moment.