cannot store a value which equal to its range limit
Bug #953112 reported by
vanh souvanlasy
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libECBUFR |
Fix Committed
|
Medium
|
vanh souvanlasy |
Bug Description
the encoder is rejecting a value that is equal to its descriptor's valid range lower or upper limit value.
For example descriptor 13011, this should take any value between [-0.1, 1638.1]
But the value -0.1 cannot be stored and a default missing value is used instead.
Debug show that value of -0.1 was rejected because it is out of range.
Changed in libecbufr: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → vanh souvanlasy (vanh-souvanlasy) |
Changed in libecbufr: | |
status: | In Progress → Fix Committed |
Changed in libecbufr: | |
milestone: | none → 0.8.5 |
To post a comment you must log in.
Looks like the internal test of value range is done between a double and a float. 100000000000000 01 =min)&& (value< =max))
For a float -0.1 is stored as value=-0.100000001 and stored in a double as min=-0.
The double were used for the range and float was used for value to test.
Which fails the test: if ( (value>
value is smaller than min
A simple solution would be to cast double to float before comparing the two values.