Bugzilla – Bug 759
Quaternion function angularDistance is hardcoded for double math
Last modified: 2014-03-12 14:06:18 UTC
The angularDistance function in Quaternion.h uses an explicit double type variable in an intermediate step. I believe the word 'double' on line 670 should be changed to 'Scalar'. This is the only place double is used this way in Quaternion.h, so I think it's just a mistake.
On the next line the constant 1.0 should be Scalar(1) for similar reasons. This change would make it consistent with use elsewhere.
A user working exclusively with Quaternionf types would be surprised by the use of double math trig. I found the bug when turning on -Wdouble-promotion, as I'm working on an ARM Cortex-M4 with hardware support for single precision only.
Thanks for reporting this. Fixed in devel and 3.2: