|
|
|
|
|
by ahupp
914 days ago
|
|
IMO using operator overloading for this kind of thing makes it hard to read, since I have to be extra careful to mentally parse whether that `*` is a multiplication or units, remember what variables are in scope etc. Notation matters, and if I didn't care about that I'd just write `pint.Quantity(5, "meters/second")` and be done with it. Or more likely, not go to the trouble of using them at all. > I don’t understand why you’d go to the enormous trouble But more importantly, it was just really fun to get it working. |
|
Units are inherently exactly multiplication.
5 meters is:
5 (unitless) * (1) meter