ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
@benthebear93, that is the natural behaviour of floating points numbers, it a representationm problem.
round(value * 1000) / 1000;
That is rounder the value
number to the 4th decimal digit. So the number -9.08240001381 will be -9.0824.But at the end of the day you will have decimals that you do not want since thats is how floating point representation works.
If anyone knows any other trick to solve this problem I will glad to discuss it here.
Regards.