6 ms·
It's not really overloading. it is associative: 2*time.Hour+1*time.second == time.Second+time.Hour*2
by rwcarlsen 4y ago
It's not really overloading. it is associative:
2*time.Hour+1*time.second == time.Second+time.Hour*2
- wtallis 4y agoI believe that's illustrating commutativity, not associativity.
- thaumasiotes 4y agoThe illustration is wrong, but the claim is correct; multiplication between units and scalars is just as associative as you'd expect. Multiplying one kilowatt by an hour gives you exactly the same result as multiplying 1 by a kilowatt-hour.