Post Reply 
HP Prime complex division problem in CAS
11-20-2020, 12:05 AM
Post: #4
RE: HP Prime complex division problem in CAS
Hi Albert

This calculator looks pretty, but it's not a good old Hewlett Packard product, it's like someone in the beginner's programming course made it in practice.

Anyway, having a workaround is better than nothing. Rewritten in CAS form.
Code:
#CAS
// This is a workaround for the dynamic range problem of complex division and abs() in CAS.
// Conforms to HP Prime software version 2.1.14433 (2020 01 21).
// cdev -- complex division, returns x / y.
cdiv(x, y):=
BEGIN
  LOCAL n;
  n := 1.0 / maxnorm(y);
  return (x * n) / (y * n);
END;
// cabs -- returns magnitude of z
cabs(z):=
BEGIN
  LOCAL n;
  n := maxnorm(z);
  return abs(z / n) * n;
END;
#END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime complex division problem in CAS - lyuka - 11-20-2020 12:05 AM



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