GithubHelp home page GithubHelp logo

numworks-rpn's Introduction

numworks-rpn

This is a RPN calculator for NumWorks.

Getting started

git clone https://github.com/boricj/numworks-rpn.git apps/rpn

# Quick test run on simulator
make PLATFORM=simulator EPSILON_APPS='rpn settings'

# Complete firmware on hardware
make EPSILON_APPS='rpn graph code statistics probability solver calculation sequence regression settings' epsilon_flash

Key mapping

  • EXE: DUP
  • Ans: OVER
  • Right parenthesis: SWAP
  • Left parenthesis: ROT
  • Space (alpha+'-'): Insert minus sign
  • Equal (shift+pi): Switch between exact and approximation modes

numworks-rpn's People

Contributors

0b101 avatar boricj avatar gegenter avatar qguv avatar quentinguidee avatar redgl0w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

numworks-rpn's Issues

Cursor bug in RPN

If you select the first or second line when the 8 lines are used, the cursor duplicates on the next line.

screenshot (3)
screenshot (5)

Omega Version : 1.18.4

Compilation error with current epsilon release

Hello, I tried building the current epsilon release (11.2.0) with rpn app included and the compilation fails with the following error:

/home/jacopo/epsilon-11.2.0/apps/apps_container_storage.cpp:24: undefined reference to `Rpn::App::Snapshot::Snapshot()'
collect2: error: ld returned 1 exit status
Makefile:126: recipe for target 'build/device/epsilon.elf' failed
make: *** [build/device/epsilon.elf] Error 1

Everything works fine if I leave the rpn app out of the build. I don't know if this issue is caused by #9, any idea what it could be? Thanks

Yes!

Just yes to this 👍

Error with compilation

I've tried to compile epsilon 12.0.0 with rpn and it doesn't work
The logs :

➜  epsilon git:(master) ✗ sudo make PLATFORM=simulator EPSILON_APPS='rpn settings'
CXX     apps/main.o
In file included from ./apps/rpn/rpn_prompt_controller.h:7:0,
                 from ./apps/rpn/app.h:6,
                 from <command-line>:0:
./apps/rpn/rpn_stack_controller.h:19:7: error: ‘int Rpn::RpnStackController::numberOfRows()’ marked ‘override’, but does not override
   int numberOfRows() override { return m_rpnStack->length(); }
       ^~~~~~~~~~~~
In file included from ./apps/rpn/app.h:6:0,
                 from <command-line>:0:
./apps/rpn/rpn_prompt_controller.h:58:22: error: cannot declare field ‘Rpn::RpnPromptController::m_stackController’ to be of abstract type ‘Rpn::RpnStackController’
   RpnStackController m_stackController;
                      ^~~~~~~~~~~~~~~~~
In file included from ./apps/rpn/rpn_prompt_controller.h:7:0,
                 from ./apps/rpn/app.h:6,
                 from <command-line>:0:
./apps/rpn/rpn_stack_controller.h:11:7: note:   because the following virtual functions are pure within ‘Rpn::RpnStackController’:
 class RpnStackController : public ViewController, public ListViewDataSource, public SelectableTableViewDataSource {
       ^~~~~~~~~~~~~~~~~~
In file included from escher/include/escher/list_view_data_source.h:4:0,
                 from escher/include/escher.h:38,
                 from ./apps/rpn/app.h:4,
                 from <command-line>:0:
escher/include/escher/table_view_data_source.h:9:15: note: 	virtual int TableViewDataSource::numberOfRows() const
   virtual int numberOfRows() const = 0;
               ^~~~~~~~~~~~
Makefile:188: recipe for target 'output/simulator/release/apps/main.o' failed
make: *** [output/simulator/release/apps/main.o] Error 1

Opposite operator

Thank you for taking into consideration the alpha+- key as '-' symbol in the edit line. That fixed the problem with minus sign in matrices but the opposite operator is gone. It would be great if the alpha+- had 2 behaviours : one during edition where it inserts '-' at the cursor's position, and one when nothing is edited where it takes the stack[0]'s opposite.

"Ghost" characters

In emulator and real calculator, when you push a number to a stack, the number you entered stays...
image

[Question] License

Bonjour,

Je suis en train de créer avec 2 autres contributeurs une version modifiée d'Epsilon, dénommée Omega. Nous souhaitons proposer des fonctionnalités que Numworks ne propose pas, et installable facilement (un contributeur a créé un installateur automatique pour cela).

Nous souhaitons intégrer une app RPN, et trouvons la votre assez avancée. Avons-nous le droit de réutiliser votre application dans notre version modifiée, bien sûr en vous mentionnant dans les contributeur ?

Merci d'avance,

Quentin G.

Negative numbers in matrices

I tried to type in a matrix in the RPN app. It seems to work except for the negative numbers. When I hit alpha+- for an element, the whole matrix is impacted. How can I put negative numbers in a matrix ?

ROT stack is wrong after DUP

Step to reproduce

1 EXE
2 EXE
3 EXE
EXE
( <= now it just rotates 3 numbers while stack has 4 numbers

Environment

Omega version 1.19.2 on Android phone

Select layout input after pushing in stack

If you push something on the stack, your cursor won't appear, neither in the stack, neither in the layout input. If you want to make it appear, you've to go up to the stack, then to go down to the layout input.

Add an inverse operator

It would be very useful to have an unary inverse operator.

Currently I’m either:

  • adding -1 to the pile and using the function then,
  • or adding 1 to the pile, SWAPing and then pressing ÷
  • or even using the inverse() function for Matrices in the Toolbox!

but it would be nice to have a dedicated INV function. I imagine that shift + ÷ would be a convenient key sequence for the implementation.

What you do think?

Unexpected undef result

I've been playing with the RPN App in Omega and I really like it.

But I've also found something weird: This produces an undef result: 1.0000001 x^2 x^2 x^2 x^2 x^2 (enter 1.0000001 and press the square function 5 times). It happens both in exact and approximate modes.

It seems that results are kept in exact form and the integers in the fraction grow too large and become undef.

The Calculation App doesn't have this problem:
1.0000001 EXE ans^2 EXE ans^2 EXE ans^2 EXE ans^2 EXE ans^2 EXE produces 1.000003 (1000003200004560003200001/1E24; so it seems to limit the carried precision)

I have mixed feelings with this problem: I like the idea of RPN maintaining internal exact results always, but as this example shows, that can get out of hand quickly. In this example, since I entered the number as a decimal (and specially If I'm using approximate mode) I would expect an possibly inexact answer, but not an undefined value.

I think precision should be limited at some point like in the Calculation App, maybe only in the approximate mode. In this example the result is OK while numerator and denominator have 113 decimal digits. The operation that fails would have produced integers with 225 digits, so I guess the limit lies somewhere in between.

Make MathToolbox reusable within epsilon

This patch is currently required to build numworks-rpn, a proper fix must be integrated upstream:

index 77bc6bd56..d0301efc0 100644
--- a/apps/math_toolbox.h
+++ b/apps/math_toolbox.h
@@ -7,9 +7,9 @@
 class MathToolbox : public Toolbox {
 public:
   MathToolbox();
+  const ToolboxMessageTree * rootModel() const override;
 protected:
   bool selectLeaf(int selectedRow) override;
-  const ToolboxMessageTree * rootModel() const override;
   MessageTableCellWithMessage * leafCellAtIndex(int index) override;
   MessageTableCellWithChevron* nodeCellAtIndex(int index) override;
   int maxNumberOfDisplayedRows() override;

Erreur a la compilation

J'ai essayer de compiler ceprojet qui a l'air d'etre incroyable et make me ressort une erreur (je ne comprend ni make ni C/C++ donc pour moi c'est du charabia)
La sortie de make est ci-dessous, esperant que cela aide

xxxx@xxxxxxx:~/Code/epsilon$ make PLATFORM=simulator EPSILON_APPS='rpn settings'
CXX     apps/rpn/rpn_stack.o
apps/rpn/rpn_stack.cpp: In constructor ‘Rpn::RpnStack::RpnElement::RpnElement(Poincare::Expression&, Poincare::Context&)’:
apps/rpn/rpn_stack.cpp:14:109: error: no matching function for call to ‘Poincare::Expression::simplify(Poincare::Context&, Poincare::Preferences::AngleUnit)’
 exp.simplify(context, Poincare::Preferences::sharedPreferences()->angleUnit());
                                                                              ^
In file included from apps/rpn/rpn_stack.h:5:0,
                 from apps/rpn/rpn_stack.cpp:1:
poincare/include/poincare/expression.h:191:14: note: candidate: Poincare::Expression Poincare::Expression::simplify(Poincare::Context&, Poincare::Preferences::ComplexFormat, Poincare::Preferences::AngleUnit)
   Expression simplify(Context & context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit);
              ^~~~~~~~
poincare/include/poincare/expression.h:191:14: note:   candidate expects 3 arguments, 2 provided
apps/rpn/rpn_stack.cpp:25:3: error: no matching function for call to ‘Poincare::Expression::approximate<double>(Poincare::Context&, Poincare::Preferences::AngleUnit, Poincare::Preferences::ComplexFormat)’
   );
   ^
In file included from apps/rpn/rpn_stack.h:5:0,
                 from apps/rpn/rpn_stack.cpp:1:
poincare/include/poincare/expression.h:201:35: note: candidate: template<class U> Poincare::Expression Poincare::Expression::approximate(Poincare::Context&, Poincare::Preferences::ComplexFormat, Poincare::Preferences::AngleUnit) const
   template<typename U> Expression approximate(Context& context, Preferences::ComplexFormat complexFormat, Preferences::AngleUnit angleUnit) const;
                                   ^~~~~~~~~~~
poincare/include/poincare/expression.h:201:35: note:   template argument deduction/substitution failed:
apps/rpn/rpn_stack.cpp:23:58: note:   cannot convert ‘Poincare::Preferences::sharedPreferences()->Poincare::Preferences::angleUnit()’ (type ‘Poincare::Preferences::AngleUnit’) to type ‘Poincare::Preferences::ComplexFormat’
     Poincare::Preferences::sharedPreferences()->angleUnit(),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Makefile:67: recipe for target 'apps/rpn/rpn_stack.o' failed
make: *** [apps/rpn/rpn_stack.o] Error 1

Error on n0100

When you compile latest version of epsilon with rpn mode, on the n0100, the calculator crashes...
But on the emulator it works !

[Question/Suggestion] Matrices

Bonjour,

Je souhaiterais savoir si l'application RPN supporte les calculs matriciels.

Si ce n'est pas le cas serai-ce faisable ?

Merci d'avance

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.