Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rwcarlsen
· 4y ago · 0 comments
It's not really overloading. it is associative:
2*time.Hour+1*time.second == time.Second+time.Hour*2
Comments
[–]
wtallis
4y ago
I believe that's illustrating commutativity, not associativity.
[–]
thaumasiotes
4y 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.