Post Reply 
Change name for →Qπ - please suggest!
11-17-2017, 12:06 AM (This post was last modified: 11-17-2017 08:08 AM by StephenG1CMZ.)
Post: #25
RE: Change name for →Qπ - please suggest!
What would a novice think QPI(4.5) means if they saw it in the source code and hadn't previously read this thread?
PPL supports implied multiplication, yes?
So QPI(4.5) can be parsed as QPI*(bracketed-expression), yes?
I haven't looked it up yet, but I might guess its a constant equal to QuarterPi, or Pi/4, multiplied by 4.5. (For comparison: many algorithms use the constant TwoPi = 2*Pi to avoid the cost of a multiply).

So let's forget the reference to Pi, at least, which it has nothing to do with.

To be consistent with other HP Prime conversion names, such as mat2list, something like fp2exact seems reasonable for now. However, the "fp" part bothers me.
Why?
What would you expect fp2exact(#2) to do?
Or fp2exact(2.1+2.2i)
The intuitive result of giving it a complex number seems obvious enough:
21/10 + (22/10)i or something (I haven't checked exactly what the output should be, but I guess it should be complex)
So do we need
Complex2exact
String2exact etc.?

Perhaps just
Convert2exact(anything), or ToEXACT for brevity,
But then for consistency mat2list ought to be
Convert2list or Tolist etc.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Change name for →Qπ - please suggest! - StephenG1CMZ - 11-17-2017 12:06 AM



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