https://github.com/h4wk507/qtcalculator
Arithmetic expression parser built using C++ and Qt for GUI.
https://github.com/h4wk507/qtcalculator
calculator cpp gui qt qt-calculator qt5 qtcreator
Last synced: about 2 months ago
JSON representation
Arithmetic expression parser built using C++ and Qt for GUI.
- Host: GitHub
- URL: https://github.com/h4wk507/qtcalculator
- Owner: H4wk507
- License: mit
- Created: 2022-04-08T17:45:50.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-18T13:42:10.000Z (over 3 years ago)
- Last Synced: 2025-03-31T06:28:34.777Z (about 1 year ago)
- Topics: calculator, cpp, gui, qt, qt-calculator, qt5, qtcreator
- Language: C++
- Homepage:
- Size: 164 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QtCalculator
A simple GUI calculator built using Qt and C++

## Intro
This program can calculate most of basic mathematical expressions
by evaluating them accordingly to the [Order of operations](https://en.wikipedia.org/wiki/Order_of_operations).
It supports:
- All arithmetic operations (including '=' sign for variable assignment)
- All bitwise operations (~, &, ∨, ^, <<, >>)
- Other helpful operations such as: modulus division, exponentiation,
absolute value and scientific notation (2E5 = 2 × 105)
- Multiple number bases (binary, octal, decimal and hexadecimal)
- Basic functions such as: sine, cosine, lcm and gcd
- Scrolling through result history by using arrow up and arrow down keys
## Examples
Examples of expressions that this program can calculate:
```
2 + 2 = 4
(0 + 913972 - 1000) * 3 / 2 % 999 = 828
2|1 - 3| + 2|1 - 3| = 8
((13) << 8) >> ((127) % 10 & (31 + 7)) = 52
(5 << 1) ∨ (5 << 2) ^ (5 << 3) = 62
(0 + ~(0xDF234 & 1000) * 3) / -2 = 817.5
1 + (((2 + (3 + (4 + (5 + 6) * -7))) & 127) << 1) * -3 = -359
2sin(3.1415 / 2) + 3cos(0) = 5
gcd(24, 36) = 12
0xFF + 0b11 - 015 = 245
x = 3
x**3 + 3x**2 + 3x**1 + x**0 = 64
```
## Setup
1. Go into the project directory
2. Create a build folder and go into it
```shell
mkdir build && cd build
```
3. Compile using CMake
```shell
cmake .. && make
```
4. Run it
```shell
./Calculator
```
## License
Licensed under MIT.