newRPL: symbolic numbers

12292014, 03:19 PM
Post: #14




RE: newRPL: symbolic numbers
(12242014 07:51 PM)Claudio L. Wrote: * Forget about quoted numbers. Actually, I'd like to take that back. Reading back the whole thread made me realize this still needs quoted numbers: Quote:The idea would be something like this: So quoted numbers will exist, alongside the trailing dot: { 45 45. '45' '45.' } SIN will return {0.707... 0.707... 'SIN(45)' 'SIN(45.)' } and after EVAL, {0.707... 0.707... 'SIN(45)' 0.707... } Also, I think the trailing dot concept could also be extended to variable identifiers and constants. For example, typing: π will leave the symbolic constant π on the stack. But typing π. (with the dot) should leave 3.1415.... on the stack. Same thing for variables. If the variable name is followed by a dot, it is interpreted as an approximated expression, and upon evaluation, it's numeric value will be calculated and returned, as if >NUM was executed. For example: 2 'X' STO 'X^2' 'Y' STO Now, typing Y will leave 'X^2' on the stack. Y. will leave 4 on the stack. 'Y+1' EVAL will leave 'X^2+1' and another EVAL will produce the number 5. 'Y.+1' EVAL will produce '4+1' and another EVAL the number 5. Note: The need for multiple EVAL's is because as of now newRPL CAS doesn't do recursive substitutions (the 50g would show the number 5 on the first EVAL). Perhaps a command EVALALL will be added, or perhaps EVAL will behave like the 50g, and a new command like EVAL1 will do a nonrecursive singlestep as shown above, this is still in the works and subject to change. Any thoughts about these "extensions"? 

« Next Oldest  Next Newest »

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