[comp.sys.handhelds] Numbers in algebraics

hulsund@vsfys3.fi.uib.no (John Einar Hulsund) (04/11/91)

  >Does anyone know how to force symbolic notation on a numerical value?
  >     ie. 1: '5'
  >The idea being that I can build a numerical equation from this number...
  >     ie. 1: '\v/5'         @ square root of 5.
  > 
  >I would not mind doing '\v/a' and then substitute the value of a, but
  >I don't know of a way to do this.
  >     Maybe MATCH?? ....Never used it before, and there's gotta be a 
  >     simpler solution.
  > 
  >All suggestions are appreciated.  I hope this isn't a dumb question...
  >I hate asking dumb things...On the other hand, maybe there's a stupid
  >solution...
  > 
  >Thanks in advance,
  >-Dave.

   Try this: Put a string on the stack containing a singel-quote and a
   square-root.
       1:          "'\v/"
   Then type: 5 [ENTER] +
   Finish by executing OBJ\->

   - John E H

cloos@acsu.buffalo.edu (James H. Cloos) (04/12/91)

In article <1991Apr11.131205.11941@lilje.uib.no> hulsund@vsfys3.fi.uib.no writes:
>
>  >Does anyone know how to force symbolic notation on a numerical value?
>  >     ie. 1: '5'
>  >The idea being that I can build a numerical equation from this number...
>  >     ie. 1: '\v/5'         @ square root of 5.
>  > 
>  >I would not mind doing '\v/a' and then substitute the value of a, but
>  >I don't know of a way to do this.
>  >     Maybe MATCH?? ....Never used it before, and there's gotta be a 
>  >     simpler solution.
>  > 
>  >All suggestions are appreciated.  I hope this isn't a dumb question...
>  >I hate asking dumb things...On the other hand, maybe there's a stupid
>  >solution...
>  > 
>  >Thanks in advance,
>  >-Dave.
>
>   Try this: Put a string on the stack containing a singel-quote and a
>   square-root.
>       1:          "'\v/"
>   Then type: 5 [ENTER] +
>   Finish by executing OBJ\->
>
>   - John E H

Another possibility, if you have either the standalone \->ALG, or Rick's
HACKIT library (I recommend the latter to everyone, doesn't take up too
much mem, and you'll always find a use for it), then do a 1 \->ALG on the
5, before you hit the \v/ key.  It'll do what you want....  Really it will.
You could also make a program that would look like, in ASC notation:

"D9D20ECE819FF3018F453004018F453504018F45B704018F45B213038D4"

name it something like SYM.SQRT (for symbolic square root), and assign that
function to your SQRT key (44.1).  This will correctly apply the sqrt
function to reals, complex's, units, globals, and symbolics, in the
symbolic manner you want.  (What it does is call the routine that \v/ calls
when it is passed a global or symbolic, no matter which (of the above 5)
type of argument it is passed; this routine is at #54F81h.)

This procedure can be used for any of the functions in the 48 that, when
passed a symbolic argument, return a symbolic rather than evaluating it.
Also note that if flag -3 is SET, this will not work, as the returned
symbolic is immediately eval'ed.  Perhaps I'll put together a library of
these functions returning only symbolic results, given flag -3 is CLEAR.

-JimC
--
James H. Cloos, Jr.		Phone:  +1 716 673-1250
cloos@ACSU.Buffalo.EDU		Snail:  PersonalZipCode:  14048-0772, USA
cloos@ub.UUCP			Quote:  <>