News for hackers. Stuff that matters.
Re:Fundamental Math for Game Developers by ta123456789 on Wednesday February 08, 2023 @02:58AM (#34705396)
> you should not, absolutely not translate math notation to code.

I don't see a problem, if eg it helps with getting some intuition.

Sure there is a formula for this example. But the point in the article of writing this sum as a for loop is to explain what the notation means.

For a programmer who is not familiar with sigma/pi notation for sum/product, explaining it with a for loop is a quick way to understand.

Re:Fundamental Math for Game Developers by SamBam on Wednesday February 08, 2023 @09:36AM (#34708548)
Exactly, that was my take-away. You don't need to think of the Sum function as a for-loop every time you use Sum, but it certainly helps explain it to a programmer who doesn't have a sense of what Sum is, but knows what a for-loop is.