How do you extract the root in App Inventor?

Hello,

I'm currently programming a calculator with App Inventor (the Python program for the APK didn't work). Unfortunately, the "√" symbol doesn't work as a square root when I press "="…

I've heard of "sqrt()," but I have to put parentheses after the number I want to take the square root of. If a user doesn't know that, they can't take the square root.

Does anyone know how I can extract the square root using a different symbol?

Looking forward to your answers, Alex.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
4 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
FaTech
1 year ago

Your new code makes it easier to understand.

My idea for it:

  • Save in a variable when root is pressed and once another character is pressed, it is queried before the other character: If root variable true, then first set clamp. And later before recreating a replace to change the character to function.
  • If there is a Delete button to delete individual characters, this is of course a problem because the user can then remove the clip. At this point I can only recommend another plugin (have never tested it myself because I use real programming languages): https://community.appinventor.mit.edu/t/free-extension-xreg-v1-2-pcre-regular-expressions-for-app-inventor/85818 . The plugin allows you to apply RegEx to determine and replace the root points before the final calculation, although you do not know which numbers were used.

I worked with AppInventor years ago before I started with real app development. At that time everything was still in English. Was really surprised at the screenshots in German ^^

FaTech
1 year ago
Reply to  Alex950130

I wanted to deal with something like this, because I need to change all operator functions again on your first solution proposal…

How do you have to change them?

And well, still my option 2 remains

I also worked with Python myself, but unfortunately I could not convert my program into an APK,

Python is also not really a language for which such behavior is intended. There are usually frying solutions to create something like this, but usually other languages are used for it. I myself am a fan of C#, because it can be anything but simple and yet so powerful.

In the App inventor there are also many languages.

Interesting, but a few years too late, haha. I still find more interesting 🙂