diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-05-06 17:43:26 +0300 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-05-08 09:16:07 +0200 |
| commit | 58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e (patch) | |
| tree | dec50c945b01d09c5cf94d0665a6996e2d34ae5d /src/nad_intr.c | |
| parent | 8fef2126f1c9fa17b79e6669f4457c299c0e33bf (diff) | |
| download | PROJ-58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e.tar.gz PROJ-58cbb9fe4f89b9febd780f7bdcfa4c2bb74a723e.zip | |
Replace int typecasts with calls to lround to avoid bad conversions on NaN input. Added test to check for those cases.
Diffstat (limited to 'src/nad_intr.c')
| -rw-r--r-- | src/nad_intr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nad_intr.c b/src/nad_intr.c index 80e428ed..1f9d1e0c 100644 --- a/src/nad_intr.c +++ b/src/nad_intr.c @@ -14,9 +14,9 @@ nad_intr(LP t, struct CTABLE *ct) { int in; t.lam /= ct->del.lam; - indx.lam = isnan(t.lam) ? 0 : (int)floor(t.lam); + indx.lam = isnan(t.lam) ? 0 : (pj_int32)lround(floor(t.lam)); t.phi /= ct->del.phi; - indx.phi = isnan(t.phi) ? 0 : (int)floor(t.phi); + indx.phi = isnan(t.phi) ? 0 : (pj_int32)lround(floor(t.phi)); frct.lam = t.lam - indx.lam; frct.phi = t.phi - indx.phi; |
