Giter VIP home page Giter VIP logo

calculator's Introduction

Calculator

Calculator is a terminal based calculator implemented entirely in C.

Usage

calc <formula>

Installing

git clone [email protected]:Anthhon/calculator.git
cd calculator
make build-linux # or make build-windows
./build/calc -t

After using these commands above, you should see a sequence of successful messages on your screen, signalizing that the application is working correctly. After that, the program can be installed automatically into your Linux system by using this command:

make install-linux

Project Roadmap

  • Arguments parsing
  • Implement lexer to tokenize input
  • Implement formula interpreter
  • Create test script

Features

  • Handle 4 basic operations (+, -, *, /)
  • Handle number powering (^)
  • Negative number operations
  • Float number operations
  • Handle {[()]} symbols
  • Handle logarithmic

Contact

If you have any questions, suggestions, or need assistance, feel free to reach out to the project maintainers by opening an issue.

Also, don't forget to check the project roadmap section and see if anything interest you.

We appreciate your interest in contributing to calculator and look forward to your contributions!

References

calculator's People

Contributors

anthhon avatar

Stargazers

c0mrade  avatar

Watchers

 avatar

Forkers

serenturhal

calculator's Issues

Fixing unexpected behavior at interpreted calculator.

Problem:

In the process of testing the calculator I noticed that sometimes some unexpected behavior happened in a way that if I ran the app X times, in something around 8% of the cases the tests failed. Down below there is some tests that I had done to check that correctly:

Error checking:

Here I just ran the calculator tests some hundreds of times and stored the output into a file:

for x in {0..200}; do ./build/calc -t >> loop_analysis.txt; done

Which, after some text parsing, generated a file just as like I got something like this:

Succeeded!
Succeeded!
Succeeded!
Succeeded!
Succeeded!
Succeeded!
Succeeded!
Succeeded!

Succeeded!
Failed! (code 11)
Failed!
Failed!
Succeeded!
Failed!
Succeeded!
Succeeded!
.
.
.

So I used grep to count how much errors did I get, and got this:

echo "Succeeded: " && grep -c "Succeeded" loop_analysis.txt && echo "Failed: " && grep -c "Failed" loop_analysis.txt

Succeeded: 
1454
Failed: 
154

So certainly this is in some way getting some undefined behavior at some point that i'm not sure.

The expected behavior would be to have consistent and successful test results without any intermittent failures.

Request

I'm seeking assistance in resolving these intermittent test failures. I've tried to isolate the issue and attempted basic debugging, but the root cause remains elusive. It could potentially unexpected inputs, or other factors triggering this behavior.

Could someone proficient with debugging and testing help investigate and correct this issue properly? Any insights, suggestions, or debugging tips would be greatly appreciated.

Thank you for your help!

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.