Opened 12 years ago
Closed 12 years ago
#5369 closed Bugs (fixed)
quaternion/octonion pow() not working
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | math |
Version: | Boost 1.46.0 | Severity: | Problem |
Keywords: | Cc: |
Description
The pow() functions for quaternions/octonions do not work as they call quaternion<T>(1) instead of quaternion<T>(T(1)).
The attached patches fixes this.
Attachments (3)
Change History (6)
by , 12 years ago
Attachment: | quat.patch added |
---|
comment:1 by , 12 years ago
Works for me - what compiler are you using, and do you have a test case please?
Note that quaternion<T>(1) and quaternion<T>(T(1)) should be exactly equivalent as in the former case the argument will be promoted to T anyway.
comment:2 by , 12 years ago
g++ 4.5.2
For simple types it works, but if there are multiple levels of indirection, it does not. The attached example shows that. A quaternion<Wrapper<int> > works, a quaternion<Wrapper<Wrapper<int> > > does not.
Of course that example is somewhat silly, but I stumbled across this in a case where I do have more than one level of indirection - and not of the same class, naturally.
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch for quaternion.hpp