ECCC-MSC / libecbufr

libecbufr is a general purpose, template-oriented BUFR encoding/decoding library
Other
10 stars 7 forks source link

negative values can only be represented by floating point #15

Open vsouvan opened 4 years ago

vsouvan commented 4 years ago

In a nutshell, the "missing" value for INT32 and INT64 types is -1 (see bufr_missing_int()). This means that while someone could create a BufrValue with an INT32 type (cough bufr_set_key_qualifier_int32() cough), they'll be silently burned if they ever want assign a legitimate -1 to that value.

It would be far better if BUFR conventions were followed and "extreme" datatype-appropriate values like INT_MIN or INT_MAX were used to represent "missing" rather than a single integral "magic" number like -1 which conflicts with legitimate BUFR values.


Imported from Launchpad using lp2gh.

vsouvan commented 4 years ago

(by chris-beauregard) r235 is a hint as to what I was trying to accomplish when I found this problem...