GithubHelp home page GithubHelp logo

2a5f / l-exp Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 9 KB

Just a try / It is an extended version of a prefix expression

Home Page: http://static.abits.io/l-exp/

License: MIT License

HTML 2.56% JavaScript 97.44%
prefix-notation polish-notation left-notation l-expression math left-expression prefix-expression prefix left

l-exp's Introduction

It is an extended version of a Prefix Notation(Polish notation)

这是一个前缀表达式(波兰表达式)的扩展

Syntax 语法

No float support temporarily 暂时不支持浮点数

  • Default is Multiplication 默认是乘法
    1 2 = 1 * 2
    
  • Can multiple values 可以一次计算多个值
    +1 2 3 4 5 = 1 + 2 + 3 + 4 + 5
    
  • , The Closure 闭合符
    /-2 1,3 = (2 - 1) / 3
    
  • ; The Back 返回符
    Back to two consecutive operators
    返回到两个连续的操作符处
    /-2+5 1;3 = (2 - (5 + 1)) / 3
    ↑      ↓
    ←-←-←-←-
    
**/3+1*9 0;8,2 = ((3 / (1 + (9 * 0))) * 8) * 2
↑↑        ↓ ↓
↑ ↖←-←-←-↙ ↓
↖-←-←-←-←-←↙

Try Online
lexp ( exp_str : string ) => com_res : number
Example:

lexp('**/3+1*9 0;8,2')







I bet someone already thought of this.
我感觉肯定早就有人想出这个了

l-exp's People

Contributors

2a5f avatar

Stargazers

 avatar

Watchers

 avatar  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.