On Fri, 14 Feb 2014, Beno?t Minisini wrote:
> Le 11/02/2014 21:15, Tobias Boege a ?crit :
> > 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
> >
> 
> Arf... This is because Complex to Float conversion takes the modulus 
> value, so -18 as a complex becomes +18.
> 
> Mmm... that was a weird choice. We can even call that a bug.
> 
> I must leave now, but I think I will replace that by taking the real 
> part of the complex number if the imaginary part is zero, and raising a 
> conversion error instead.
> 

Works with #6156.

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to