Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect truncation of floating-point data
If the entire parenthesized division expression is cast to float, as it was prior to this commit, C performs truncating integer division before converting to float, which always leads to a result of zero. `git-blame' traces the bug to commit d5ed7e7, which added the faulty parentheses as a matter of style. No parentheses are necessary, since increments have higher precedence than type-casts, type-casts have higher precedence than division, and division has higher precedence than comparison. The operations will execute in the desired order.
- Loading branch information