Calculations with type-safe physical units