commit | 5382a22e0eea878339c504b2a9a3b36bcd839fcc | [log] [tgz] |
---|---|---|
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Aug 28 12:36:58 2018 -0300 |
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | Tue Aug 28 12:36:58 2018 -0300 |
tree | f4208ffe221d2f42920c751c3624f17d89b07079 | |
parent | 8c8a91f2ef7acccb99e3737913faad8d48b39571 [diff] |
Corrections in the implementation of '%' for floats. The multiplication (m*b) used to test whether 'm' is non-zero and 'm' and 'b' have different signs can underflow for very small numbers, giving a wrong result. The use of explicit comparisons solves this problem. This commit also adds several new tests for '%' (both for floats and for integers) to exercise more corner cases, such as very large and very small values.