This bugzilla service is closed. All entries have been migrated to

Bug 806

Summary: Missing scalar type cast in Quaternion setFromTwoVectors()
Product: Eigen Reporter: newstzpz
Component: GeometryAssignee: Nobody <eigen.nobody>
Severity: Unknown CC: chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1, krishkanth.92
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   

Description newstzpz 2014-05-05 10:50:47 UTC
In the function QuaternionBase<Derived>::setFromTwoVectors() (file Quaternion.h line 587), I think the scalar -1 in the code 

    c = max<Scalar>(c, -1);

should be casted to Scalar like the following

    c = max<Scalar>(c, Scalar(-1));

as other scalars were done in the code.

This would be helpful for some scalar types like ceres::Jet. A compile error will occur if it is not casted.
Comment 1 Christoph Hertzberg 2014-05-05 14:35:45 UTC
Fixed in devel and 3.2.

Thanks for the report
Comment 2 Gael Guennebaud 2016-02-03 14:05:20 UTC
*** Bug 1163 has been marked as a duplicate of this bug. ***
Comment 3 Nobody 2019-12-04 13:17:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: