diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-05-24 14:56:27 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-05-24 15:04:36 +0200 |
| commit | 8795737e29efe59526565d757bc560d9d19163cb (patch) | |
| tree | 65462b902c4054581bebdd2c7ff8b693e47e565e /test/cpp | |
| parent | 6db260ff7857fcec63e5988ed43ecebc358a811d (diff) | |
| download | PROJ-8795737e29efe59526565d757bc560d9d19163cb.tar.gz PROJ-8795737e29efe59526565d757bc560d9d19163cb.zip | |
Handle double to int typecasts in ISEA better
Originally the code was doing double to int conversions like
y = (int)(x + 0.5)
which results in rounding when typecasting. In an earlier attempt to
avoid buffer overflows in integer typecasts this was changed to
y = lround(x + 0.5)
which doesn't give the origial results. We fix that here by instead
doing
y = lround(x)
It is safe to so as long as x is positive.
Diffstat (limited to 'test/cpp')
0 files changed, 0 insertions, 0 deletions
