Skip to content

How to check for correctess while using units? #473

Answered by steveraysteveray
jdacoello asked this question in Q&A
Discussion options

You must be logged in to vote

One quick way is to check the DimensionVector that a Unit points to, to check if it is the same as the DimensionVector pointed to by the QuantityKind. That at least tells you if the Unit and the QuantityKind are compatible.

Your example would fail that test.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@jdacoello
Comment options

@steveraysteveray
Comment options

@steveraysteveray
Comment options

Answer selected by steveraysteveray
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants