Page Components JavaScript DHTML


  
    rpnjcalc a javascript RPN Calculator

input.btn {align:center;color:#000000;width:50;height:22;vertical-align:middle;font-size:12}
input.bigbtn {align:center;color:#000000;width:100;height:22;vertical-align:middle;font-size:12}




  
  
    

Reverse Polish Notation
    Calculator


    

This calculator uses postfix notation also known as Reverse
    Polish Notation (RPN). This notation has many advantages over
    Algebraic notation. One advantage is that you can calculate 
    even
    complicated terms without braces.


    

An example: Suppose you want calculate 5 * (3 + 4)

     Press the following keys on the calculator: 5, enter, 3,
    enter. The 3 and 5 did go into the calculator's memory, the
    stack. Now you type 4 and press + to add. After this you just
    press * to multiply.


    

You can either operate this calculator with mouse clicks or
    you can use the keyboard.
    However some web-browsers have keyboard shortcuts which may
    conflict with the keys used by this calculator. Therefore you
    need to place the mouse over the text area below
    as this avoids the browsers keyboard shortcuts to take
    effect. The keyboard interface was tested with Mozilla, MS IE and Opera.
    It does not work with Netscape 4.


    

rpnjcalc comes with a small manual which you can find here:
rpnjcalc-help-0.1.html




    

      
                "#CCCCCC" summary="calculator">
          
            
              rpnjcalc version 1.6
          
          
                        onclick="sto4(this.form)">             size="14">             "rcl4(this.form)"> 
            C:            "stack3" value="0" size="23" readonly> 
          
          
                        onclick="sto3(this.form)">             size="14">             "rcl3(this.form)"> 
            B:            "stack2" value="0" size="23" readonly> 
          
          
                        onclick="sto2(this.form)">             size="14">             "rcl2(this.form)"> 
            A:            "stack1" value="0" size="23" readonly> 
          
          
                        onclick="sto1(this.form)">             size="14">             "rcl1(this.form)"> 
            Y:            value="0" size="23" readonly> 
          
          
                        "undoall(this.form)"> 
                        "lastx(this.form)"> 
                        "swapxy(this.form)"> 
       
            
            X:            "display" value="0" size="23"> 
          
          
                        "sin(this.form)"> 
                        "asin(this.form)"> 
                        "pix(this.form)"> 
                        "onebyx(this.form)"> 
                        "powxy(this.form)"> 
                        "log10(this.form)"> 
                        "addChar(this.form, 'E')"> 
          
          
                        "cos(this.form)"> 
                        "acos(this.form)"> 
                        "addChar(this.form, '7')"> 
                        "addChar(this.form, '8')"> 
                        "addChar(this.form, '9')"> 
                        "divide(this.form)"> 
                        "addChar(this.form, 'E-')"> 
          
          
                        "tan(this.form)"> 
                        "atan(this.form)"> 
                        "addChar(this.form, '4')"> 
                        "addChar(this.form, '5')"> 
                        "addChar(this.form, '6')"> 
                        "multiply(this.form)"> 
                        "factx(this.form)"> 
          
          
                        "square(this.form)"> 
                        "sqrtx(this.form)"> 
                        "addChar(this.form, '1')"> 
                        "addChar(this.form, '2')"> 
                        "addChar(this.form, '3')"> 
                        "subtract(this.form)"> 
       
          
          
                        "expx(this.form)"> 
                        "lnx(this.form)"> 
                        "addChar(this.form, '0')"> 
                        "addChar(this.form, '.')"> 
                        "changeSign(this.form)"> 
                        "add(this.form)"> 
       
          
          
            mode:
                        onclick="changedegrad(this)"> 
                        "cx(this.form)"> 
                        "deleteChar(this.form)"> 
                        "popStackDisplay(this.form)"> 
                        name=" enter " onclick="enterx(this.form)"> 
          
        
      
      

      
                onclick="this.style.backgroundColor='#BDBDBD'" onmouseout=
        "this.style.backgroundColor='#FFFFFF'">
          For keyboard usage leave mouse cursor on this field and
          click once. Keys: 0-9.=numbers, return=enter, c=+/-, C=clear, 
                      s=swap, d=<-, p=pop, ^=y^x, l=ln, e=e^x, r=1/x 
        

      
    

    

    

    

    
     rpnjcalc was written by Guido Socher, guido at linuxfocus dot
    org, Copyright: GPL