newRPL: symbolic numbers

12302014, 04:50 PM
(This post was last modified: 12302014 05:59 PM by Han.)
Post: #21




RE: newRPL: symbolic numbers
Full disclosure: I have not read the entire thread in full detail. The suggestion regarding ~ is explained below, mostly divorced of the preexisting discussion.
The ~ notation isn't just a replacement for the secondary decimal point, which in my honest opinion is not a good idea. I don't think Y. should evaluate whatever is stored in the variable Y; in the HP48/49/50 series, Y. is a valid symbol (for a global variable). It should remain that way as never before have we allowed an operator to be attached to a symbol  without spaces. This also means we don't have to worry about the meaning of Y.X  is that a variable or is that Y. X (like how the HP48 allows 2+ to mean 2 +)? The ~ symbol is a hybrid operator/delimiter/constant declarator with a prefix notation. It behaves exactly like the "\(  \)" symbol in that it can both be an operator or used to designate an approximate value. For me, the notions of exact and approx should be limited to only symbolic objects. This allows us to "collect" approx and exact terms and keep them separate. Outside of that, everything should just be a number and whether the fraction mark is displayed for numbers with "essentially" no trailing fractional part is relegated to a system flag. This also implies that '1' is a valid symbolic object. On the HP48 I believe it autosimplified to just 1 (DOREAL as opposed to a composite DOSYMB containing a DOREAL). Examples: '~2.5+6.65' EVAL returns '~2.5+1.6' '~2.5+6.65' >NUM returns 4.1 '~2.5 * 2' EVAL returns '~2.5 * 2' '~2.5 * 2' >NUM returns 5. (or just 5 depending on the showfractionmark system flag) 2 ~ returns 2 or 2. (system flag) '2' ~ returns '~2' '2.5+5' ~ returns '~(2.5+5)' '2.5*2+~3*(.5+~6)' EVAL returns '5+ ~3*.5 + ~18' '2.5*2+~3*(.5+~6)' >NUM returns 24.5 In the long run I think it will also make it easier to implement solvers (numerical or symbolic). Edit: I suppose if you also want to implement using the fraction mark as an indicator for nonintegers (outside of the the symbolic environment) that would be fine too. Graph 3D  QPI  SolveSys 

« Next Oldest  Next Newest »

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