should there be some NumbreTraits<Quantity>::castToDouble() around q and myMin  (and myWidth but on another type)?