NOAA-EMC / wgrib2

Provides functionality for interacting with, reading, writing, and manipulating GRIB2 files.
12 stars 8 forks source link

-small_grib truncates lat/lon/dlat/dlon rather than round #142

Open webisu opened 1 week ago

webisu commented 1 week ago

When converting lat/lon/dlat/dlon to integer, truncation is used rather than rounding. Ex. initial grid has a dlat-dlon=0.02 degrees (not exact binary double precision number) When using -small_grib, the exterme value is xxx.019999 rather than xx.020000

edwardhartnett commented 5 days ago

Can you add a unit test to demonstrate this bug?

webisu commented 3 days ago

Did I forget to include the test?

On Sat, Jun 29, 2024 at 8:37 AM Edward Hartnett @.***> wrote:

Can you add a unit test to demonstrate this bug?

— Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/wgrib2/issues/142#issuecomment-2198145214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEIB7ZS35OR4JDWVYFWKKZDZJ2S5TAVCNFSM6AAAAABJ2MQO7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGE2DKMRRGQ . You are receiving this because you were assigned.Message ID: @.***>

edwardhartnett commented 3 days ago

I mean put up a PR with a test that demonstrates this problem. That is, a test which fails, but would pass if this were fixed...