XPRESSO - Expression Evaluator
#1
Some people missed here complete programs, written in QB64.....   Here is one:


XPRESSO = Expression Evaluator

  This program evaluates mathematical expressions, e.g.
    (sin(-9.56 * pi) + 2^1.5) - (0.567e9 + 3 * 1.456^0.5)
  The expressions may contain the following elements:
      - Numbers
      - operators
      - parentheses (for grouping expressions)
      - Names (of constants)
      - function calls

The program knows many mathematical functions (all of QB64 and many more), constants and important units.

So you can use it as your daily calculator...

Please read the build in Help (write "hlp" and press return).
This explains a little bit the program... but I think it is self explanatory.

For text output (constants, units, help) it uses the notepad in Windows.
On Linux it uses Geany. So if you are a Linux user you have to install Geany or change "geany" inside the program code to you favourite text editor.

I hope its a usefull application not only for QB64 fans.


Attached Files
.bas   Xpresso_en.bas (Size: 68.55 KB / Downloads: 72)
Reply
#2
Thumbs Up 
Very nice! I had an expression evaluator that I updated to do strings that soon turned into oh Interpreter.

It was based on expression evaluator called Fval$ see first post in link. It was a major development for me to finally get strings going along with math.
https://qb64forum.alephc.xyz/index.php?topic=3723.0

@BSpinoza does yours do string functions and are you planning an interpreter? I do see you have allot of formula conversions.
b = b + ...
Reply
#3
interesting but on my laptop with a 15 inches screen and a resolution of 1920x1080, it is unreadable, it would be necessary to plan to increase the display window...
Reply
#4
So far looks like standard QB64 screen 0 for me, could not get clipboard "imp" to work:
   
b = b + ...
Reply
#5
Also couldn't get a variable assignment like
test = 223
2 * test

to work. Variables would be next step here.
   
b = b + ...
Reply
#6
I love the the name! Very clever. It reminded me of the time my son was two. He was an early talker. The problem talking at that age is an inability to make certain sounds, correctly. His "tr" would come out as "f." No big deal, until one day you are driving the family in the car with the windows down, and a hook and ladder pulls up along side. The boy recognizes it, and starts yelling, Fire '*'uck! Fire '*'uck!" but I digress. As for word Espresso, well, "ex" and some words starting with "s" started out all as "es." So one day he told me something was "es-pecial" and I told him there was no such word. He told me, "Yes there is dad, it's an es-pression!"

Anyway, I wish you luck and hope you stay with the project. Very much needed for advanced calculator routines.

Pete
If eggs are brain food, Biden takes his scrambled.
Reply
#7
(10-10-2022, 02:34 PM)bplus Wrote: ...  could not get clipboard "imp" to work:

... Do'nt give up! You will find this out.



Quote:bplus:
Also couldn't get a variable assignment like
test = 223
2 * test
to work. Variables would be next step here.

I will think about that.,,
Reply
#8
There is a new version.
I have attached it in the first post of this thread.
Now its possible to assign own variables... (Greetings to bplus!)


Quote:>>> test = 1.5
TEST = 1.5
>>> sin(test)
 .9974949866040544
>>>
Reply
#9
Hallo BSpinoza! What's new?
b = b + ...
Reply
#10
(03-27-2023, 06:39 AM)bplus Wrote: Hallo BSpinoza! What's new?

@bplus:
As I have written: You can assign a variable now.
Reply




Users browsing this thread: 2 Guest(s)