Post Reply 
newRPL: symbolic numbers
12-29-2014, 03:19 PM
Post: #14
RE: newRPL: symbolic numbers
(12-24-2014 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:
{ 1 2 3 4 5 } '2' / would return { '1/2' '2/2' '3/2' '4/2' '5/2' }
{ 45 '45' } SIN would return { 0.707... 'SIN(45)' }
2 INV --> 0.5
'2' INV --> '1/2'

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 non-recursive single-step as shown above, this is still in the works and subject to change.

Any thoughts about these "extensions"?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
newRPL: symbolic numbers - Claudio L. - 12-22-2014, 11:01 PM
RE: newRPL: symbolic numbers - John Galt - 12-23-2014, 01:13 AM
RE: newRPL: symbolic numbers - Claudio L. - 12-23-2014, 03:34 PM
RE: newRPL: symbolic numbers - Nigel (UK) - 12-23-2014, 12:06 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-23-2014, 03:10 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-23-2014, 05:22 PM
RE: newRPL: symbolic numbers - Nigel (UK) - 12-23-2014, 05:57 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-23-2014, 09:01 PM
RE: newRPL: symbolic numbers - Nigel (UK) - 12-23-2014, 09:49 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-24-2014, 03:15 AM
RE: newRPL: symbolic numbers - brouhaha - 12-23-2014, 09:27 PM
RE: newRPL: symbolic numbers - Gilles - 12-24-2014, 11:12 AM
RE: newRPL: symbolic numbers - Claudio L. - 12-24-2014, 07:51 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-29-2014 03:19 PM
RE: newRPL: symbolic numbers - Gilles - 12-29-2014, 07:38 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-29-2014, 10:21 PM
RE: newRPL: symbolic numbers - Han - 12-29-2014, 09:33 PM
RE: newRPL: symbolic numbers - Gilles - 12-30-2014, 10:00 AM
RE: newRPL: symbolic numbers - Claudio L. - 12-30-2014, 02:19 PM
RE: newRPL: symbolic numbers - rprosperi - 12-30-2014, 02:26 PM
RE: newRPL: symbolic numbers - Han - 12-30-2014, 04:50 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-30-2014, 07:18 PM
RE: newRPL: symbolic numbers - Gilles - 12-30-2014, 10:18 PM
RE: newRPL: symbolic numbers - Claudio L. - 12-30-2014, 10:39 PM



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