Coder Social home page Coder Social logo

plover_rpn_calculator's Introduction

RPN Calculator for Plover

PyPI GitHub

RPN Calculator is a stack-based calculator that you can use to calculate equations directly in-line while writing. It uses reverse polish notation, where operations are written after their arguments, rather than in-between.

Commands

Definition Explanation
{:rpn_put:<characters>} Put characters into buffer.
For example: {:rpn_put:1}
{:rpn_put_ext} Put all characters after the most recent calculator command into buffer. This allows you to use regular number entry strokes rather than rpn_put strokes to put characters into buffer.
{:rpn_del_buff} Delete rightmost character in buffer.
{:rpn_clear_buff} Clear buffer.
{:rpn_clear_all} Clear and delete everything.
{:rpn_push} Parse and push buffer into stack.
{:rpn_push_bin} Parse and push buffer into stack as binary.
{:rpn_push_hex} Parse and push buffer into stack as hexadecimal.
{:rpn_add} Addition: Pop (x, y) from stack (where y is at the top) and push x + y.
{:rpn_sub} Subtraction: Pop (x, y), push x - y.
{:rpn_mul} Multiplication: Pop (x, y), push x * y.
{:rpn_div} Division: Pop (x, y), push x / y.
{:rpn_intdiv} Floor division: Pop (x, y), push floor(x / y).
{:rpn_mod} Modulo: Pop (x, y), push x mod y.
{:rpn_pow} Exponent: Pop (x, y), push pow(x, y).
{:rpn_neg} Negation: Pop x, push -x.
{:rpn_and} Bitwise AND: Pop (x, y), push x & y.
{:rpn_or} Bitwise OR: Pop (x, y), push x | y.
{:rpn_xor} Bitwise XOR: Pop (x, y), push x ^ y.
{:rpn_not} Bitwise NOT: Pop x, push ~x.
{:rpn_lsl} Logical Shift Left: Pop (x, y), push x << y.
{:rpn_lsr} Logical Shift Right: Pop (x, y), push x >> y.
{:rpn_swap} Swap top two stack items.
{:rpn_pop} Remove the topmost item.
{:rpn_dup} Duplicate top stack item.
{:rpn_func:<params>:<return>} Define custom function; parameters are separated by commas, and the return value is written using python syntax.
For example: {:rpn_func:x,y:3*x+2*y}
{:rpn_end} Mark the end of the calculation.

Here are a few things to note when using the plugin:

  • You can chain these definitions in a single stroke. For instance, "{:rpn_clear_buff}{:rpn_dup}{:rpn_put:2}{:rpn_mul}" will let you repeatedly add double the topmost item onto the stack.
  • When the stack has exactly one item, it will be formatted as a bare number, allowing you to quickly move on after calculation.
  • You can use the undo stroke (Typically *) to undo all RPN commands. This is helpful whenever you encounter an error during calculation.
  • Most operations that pop from the stack will push whatever you have in the buffer onto the stack first before popping. This allows you to, for example, use {:rpn_add} to directly add the buffer to the item at the top of the stack, without the need to stroke the rpn_push command.

plover_rpn_calculator's People

Contributors

kaoffie avatar iqubic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.