I can use your (paholg) suggestion to divide by 1 using the expected units, then visually inspect the formatted String to see if any mks values are present. If they are, then the units were unexpected and I know I have a problem with my math. Thanks dimensioned!
But... I believe this doesn't scale. Is it possible to get a public method to determine if the Dimensioned value is unitless?
Then I wouldn't have to visually inspect things to make sure only my expected type is there.
Alternatively I could format the Dimensioned value to a string and then parse the string to see if other units are there.
I'm just nervous about having to perform a mental visual check on all results.
I can use your (paholg) suggestion to divide by 1 using the expected units, then visually inspect the formatted String to see if any mks values are present. If they are, then the units were unexpected and I know I have a problem with my math. Thanks dimensioned!
But... I believe this doesn't scale. Is it possible to get a public method to determine if the Dimensioned value is unitless? Then I wouldn't have to visually inspect things to make sure only my expected type is there.
Alternatively I could format the Dimensioned value to a string and then parse the string to see if other units are there.
I'm just nervous about having to perform a mental visual check on all results.
Thoughts?