ros-drivers / rosserial

A ROS client library for small, embedded devices, such as Arduino. See: http://wiki.ros.org/rosserial
508 stars 526 forks source link

AVR Float64 conversion: fix special cases like denormal numbers & inf #442

Closed PetteriAimonen closed 4 years ago

PetteriAimonen commented 4 years ago

Currently the AVR 64-bit float conversion doesn't correctly handle denormal numbers, NaN or infinity values. For example nan becomes inf and 9.9999994e-39 becomes 0.

I know they're not very big errors for practical purposes. I just happened to have figured this out in the past so in case you are interested in a fix here it is.

mikepurvis commented 4 years ago

Sorry for the late attention here, but thank you for this contribution.