[Gambas-user] gb.gsl: pseudo-complex Vectors make different cross product

Tobias Boege taboege at ...626...
Tue Feb 11 21:15:10 CET 2014


Hi Benoit,

a strange thing this time. Using gb.gsl, we noticed that there is a way to
compute the cross product of two Vector objects in "complex" mode - but
without any complex numbers in them - which yields a different result than
other methods to compute it. Attached is a project that shows what I mean.

Note that everything is fine if we don't force the Vector to be complex and
also everything is fine if we don't insist on computing the components in
separate Float variables, as said in the comments.

Oh, and for the record, the Y component is wrong. It should be -18 every
time but using that special method above, we get +18. The vectors are
immediately taken from an application, seemingly nothing special about them.

I also noticed that wrapping each product of components into a CFloat() call
yields the correct result again... I tried that because even the debugger
didn't seem to get the type of hA[iIndex] figured out...

What may be going on there?

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector-issue-0.0.1.tar.gz
Type: application/octet-stream
Size: 5068 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140211/59a676af/attachment.obj>


More information about the User mailing list