Giter Club home page Giter Club logo

smdn / polish-notation-impls Goto Github PK

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

数式の二分木化・記法変換・計算アルゴリズムの実装

Home Page: https://smdn.jp/programming/tips/polish/

License: MIT License

JavaScript 29.92% HTML 2.58% CSS 1.51% Makefile 0.28% C 10.09% C# 11.70% Java 9.46% Python 8.02% Ruby 1.33% Visual Basic .NET 7.98% PowerShell 7.87% C++ 9.28%
algorithms binary-expression-tree calculation expression-tree polish-notation rpn-calculator rpn-expression csharp java javascript

polish-notation-impls's Introduction

GitHub Sponsors NuGet MENTA YouTube views smdn.jp

polish-notation-impls's People

Contributors

smdn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

polish-notation-impls's Issues

[Java][JavaScript] 数値が指数表記ではなく10進表記で出力される

❌ '10000000000000000/1' must be calculated to the value '1e+16', but was '10000000000000000'
input expression: expression: 10000000000000000/1
reverse polish notation: 10000000000000000 1 / 
infix notation: (10000000000000000 / 1)
polish notation: / 10000000000000000 1 
calculated result: 10000000000000000

❌ '1/10000000000000000' must be calculated to the value '1e-16', but was '0.0000000000000001'
input expression: expression: 1/10000000000000000
reverse polish notation: 1 10000000000000000 / 
infix notation: (1 / 10000000000000000)
polish notation: / 1 10000000000000000 
calculated result: 0.0000000000000001

❌ '(3/2)*(10000000000000000/1)' must be calculated to the value '1.5e+16', but was '15000000000000000'
input expression: expression: (3/2)*(10000000000000000/1)
reverse polish notation: 3 2 / 10000000000000000 1 / * 
infix notation: ((3 / 2) * (10000000000000000 / 1))
polish notation: * / 3 2 / 10000000000000000 1 
calculated result: 15000000000000000

[C] 数値で始まり記号を含む項が数値に変換される

例として、項2(1+2)が計算時に2として変換される。

❌ '6/2(1+2)' is expected to be calculated to the expression '(6 / 2(1+2))', but was '(calculated)'
input expression: expression: 6/2(1+2)
reverse polish notation: 6 2(1+2) / 
infix notation: (6 / 2(1+2))
polish notation: / 6 2(1+2) 
calculated result: 3

❌ '(2*3)/2(1+2)' is expected to be calculated to the expression '(6 / 2(1+2))', but was '(calculated)'
input expression: expression: (2*3)/2(1+2)
reverse polish notation: 2 3 * 2(1+2) / 
infix notation: ((2 * 3) / 2(1+2))
polish notation: / * 2 3 2(1+2) 
calculated result: 3

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.