Closed kartikmohta closed 7 years ago
Honestly, I don't know what the desired behavior should be in this case. Convert aims by definition at mathematical correctness. It is still possible to extract the number I guess. I will think about it
In my opinion, it should return a nan
if the input is nan
but I don't know how that can work if the destination is not a floating point type.
I found an even better solution. Check the last commit. Actually it will make convert even faster
Seems odd to have a special case for float64, but that works for me so it's ok I guess. 🙂
for the records, the template specialization for convert
Cheers and thanks for reporting
The equality check for nan always returns false which caused checkTruncation to throw "Floating point truncated" exception. Happened when loading a ROS bag in PlotJuggler containing nans in some messages.