Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot store a value which equal to its range limit #46

Open
vsouvan opened this issue Apr 19, 2020 · 1 comment
Open

cannot store a value which equal to its range limit #46

vsouvan opened this issue Apr 19, 2020 · 1 comment

Comments

@vsouvan
Copy link
Collaborator

vsouvan commented Apr 19, 2020

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.


Imported from Launchpad using lp2gh.

@vsouvan
Copy link
Collaborator Author

vsouvan commented Apr 19, 2020

(by vanh-souvanlasy)
Looks like the internal test of value range is done between a double and a float.
For a float -0.1 is stored as value=-0.100000001 and stored in a double as min=-0.10000000000000001
The double were used for the range and float was used for value to test.
Which fails the test: if ( (value>=min)&&(value<=max))
value is smaller than min

A simple solution would be to cast double to float before comparing the two values.

@vsouvan vsouvan added this to the 0.8.5 milestone Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant