Y
Hacker News
new
|
ask
|
show
|
jobs
by
rwcarlsen
1548 days ago
It's not really overloading. it is associative:
2*time.Hour+1*time.second == time.Second+time.Hour*2
1 comments
wtallis
1548 days ago
I believe that's illustrating commutativity, not associativity.
link
thaumasiotes
1548 days 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.
link