Post Reply 
Which systems support a COMPLEX data type?
07-19-2023, 06:23 PM
Post: #24
RE: Which systems support a COMPLEX data type?
(07-19-2023 02:14 PM)johnb Wrote:  
(07-19-2023 12:24 AM)FLISZT Wrote:  In R language:

Code:

a <- sqrt(-1 + 0i)            # sqrt(-1) doesn't work → Warning message: In sqrt(-1) : NaNs produced
...

(…)
Interesting that it's not smart enough to realize that -1 = (-1 + 0i).
(…)

It reminds me of the hp-15C: flag No.8 has to be set (SF 8) to handle complex numbers.
I don't know a lot about the hp-35S, but I do know that a vintage hp-28 can compute the square root of -1, (-1 0) or '-1±0*i' directly and effortless. Smile
As the expression '-1±0*i' is enclosed in quotation marks, →NUM will be necessary to get a numerical value.
In all cases, the result will be of the form (n, m) ⇒ (0, -1).

While the R language can handle complex numbers (without the need of libraries), it is certainly not the most appropriate for an engineer.
It's better suited to a statistician, a data analyst (also Python), etc.

Bruno
Sanyo CZ-0124 ⋅ TI-57 ⋅ HP-15C ⋅ Canon X-07 + XP-140 Monitor Card ⋅ HP-41CX ⋅ HP-28S ⋅ HP-50G ⋅ HP-50G
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Which systems support a COMPLEX data type? - FLISZT - 07-19-2023 06:23 PM



User(s) browsing this thread: 1 Guest(s)