|
|
|
|
|
by julian37
1403 days ago
|
|
Agreed about saturation and the choice of variable name, but the code would trigger a division by zero and not result in NaN: https://go.dev/play/p/vYm4tSNEJ7M (Also, in--say--Ruby and JavaScript 1.0/0.0 is Infinity and not NaN.) |
|
Both good examples of coding where you should be thinking instead, though.