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

read_le<T>/read_be<T> incorrectly evaluate float #1

Closed
joekale opened this issue Feb 13, 2018 · 0 comments
Closed

read_le<T>/read_be<T> incorrectly evaluate float #1

joekale opened this issue Feb 13, 2018 · 0 comments

Comments

@joekale
Copy link
Contributor

joekale commented Feb 13, 2018

While using read_be with ibeo_lux driver I noticed that scan_point xyz values were abnormally large integers. Ran a small test to recreate with read_le:

  1. Entered 123.4567 as value in IEEE floating point converter: https://www.h-schmidt.net/FloatConverter/IEEE754.html
  2. Copied Hexadecimal representation (0x42f6e9d5) from converter and generated an int using a calculator (1123477973)
  3. wrote small commandline program to take integer as input and run through read_le

output as follows (bytes print in little_endian order):

./network_util_test 1123477973
input: 1123477973
bytes: 213, 233, 246, 66
Hex Representation: 0xd5e9f642
Value of encoded float: 1123478016.000000

joekale pushed a commit that referenced this issue Apr 25, 2018
Unit tests found issues with misinterpreting floats and doubles
Modified methods and now this commit Fixes #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant