HP Forums
Bug in converting complex numbers? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Bug in converting complex numbers? (/thread-10999.html)



Bug in converting complex numbers? - blevita - 07-03-2018 08:01 AM

Hi

I have tried to convert a complex number in the style of 100*exp(60 Deg)
Usually they should be converted to something like:

100*(cos(60)+i*sin(60)) = 50+86.6*i

But the Prime converts the expression 100*exp(60 Deg) to -95.24 - 30.48*i
This is a strange behaviour to me.

Do i have to enter the complex number in an other way?
Or is this a software bug?

Attached a picture

Thank


RE: Bug in converting complex numbers? - blevita - 07-03-2018 08:17 AM

I have tested this behaviour a little bit more.
It looks like there is a serious bug in the Prime.

If i extract the RE part within the CAS it gives me the correct value of 50.
If i extract the exact same thing withing the Calculator it gives me -95.

If i approx the value within the CAS, also the CAS fails to convert correctly!

Take a look at the pictures.


RE: Bug in converting complex numbers? - sasa - 07-03-2018 08:59 AM

I do not have a Prime, however, this sems to be a problem misrepresenting input is in degree or radian and further result representation.

Do you have to set independently degree and radian for each calculator mode (HOME/CAS)?

If you check manually, you will see that second result is correct if numbers are expected in radian: sin(60)=-0,3048106211 and so on.


RE: Bug in converting complex numbers? - blevita - 07-03-2018 09:03 AM

(07-03-2018 08:59 AM)sasa Wrote:  Do you have to set independently degree and radian for both calculator modes (HOME/CAS)?

If you check manually, you will see that second result is correct if numbers are expected in radian: sin(rad(60))=-0,3048106211 and so on.

Ok interessting.
I have set the CAS and calculator to Degrees.
You can see this also on the top right corner where you see the green Dregree symbol.
I have also swithed to radians without success.

But you are right. If i enter radians, the answer is correct.
Thanks for your quick response!


RE: Bug in converting complex numbers? - sasa - 07-03-2018 09:11 AM

Notice that x in exp(x) is not expected to be an angle, thus you have to do conversion manually.


RE: Bug in converting complex numbers? - Nigel (UK) - 07-04-2018 11:04 AM

In general, trig functions on the Prime interpret any complex number as being in radians. For example, in degrees mode sin(30) is 0.5, but sin (30+0*i) is -0.988, even when a degrees sign is added after the "30".

I believe this is standard practice on calculators that support trig and exponential functions with complex arguments, so it should be viewed as a feature, not a bug!

Nigel (UK)