top | item 30749777

(no title)

rwcarlsen | 4 years ago

It's not really overloading. it is associative:

    2*time.Hour+1*time.second == time.Second+time.Hour*2

discuss

order

wtallis|4 years ago

I believe that's illustrating commutativity, not associativity.

thaumasiotes|4 years ago

The 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.