Question: Units Standard / compare values with zero

Units are a neverending story, here's a variant of a problem raised before.

How can i get the minimum of 2 values with Units[Standard] loaded, when one of them could be zero (this loosing its units)?

See also 

  • https://www.mapleprimes.com/questions/229640-Units-Disappearing
  • https://www.mapleprimes.com/questions/230165-Error-in-UnitsTestDimensions-Invalid
  • https://www.mapleprimes.com/questions/230064-Compare-Similar-Units

with(Units[Standard])

a := 15*Unit('m')

15*Units:-Unit(m)

(1)

b := 13000*Unit('mm')

13000*Units:-Unit(mm)

(2)

min(a, b)

13*Units:-Unit(m)

(3)

c := 0*Unit('m')

0

(4)

min(a, c)

Error, (in Units:-Standard:-min) units with incompatible dimensions found: {1, length}

 

``


 

Download UnitsStandardCompare.mw

Please Wait...