Re:Why don't schools teach debugging? (2014)
by julian_1 on Tuesday April 25, 2017 @07:27AM
(#14192490)
4 / 3 would be computed as an integer (eg. 1), before the result is implicitly coerced to float for the rest of the expression calculation?
A nice example for debugging, and for understanding the value of languages with better typing discipline.
Re:Why don't schools teach debugging? (2014)
by the-dude on Tuesday April 25, 2017 @07:07AM
(#14192395)
Circle has no volume
Re:Why don't schools teach debugging? (2014)
by noxToken on Tuesday April 25, 2017 @09:36AM
(#14193348)
Although I laughed, I'm sure GP meant sphere. That is the correct formula for volume of a sphere, and a sphere is a circle in 3-space.
If you're doing C (or any other language where that particular problem exists), it's always a nice exercise to have students write a program (or a function) that takes the radius of a circle and outputs its volume. Most students will write:
Can you see the problem? ;)