Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error message when more than 2 numbers are entered #1

Closed
adnan360 opened this issue Mar 22, 2021 · 3 comments
Closed

Show error message when more than 2 numbers are entered #1

adnan360 opened this issue Mar 22, 2021 · 3 comments

Comments

@adnan360
Copy link

Thanks for creating the project.

First, I tried:

$ ./bcalc '1+1'
2
$ ./bcalc '(1+1)*2'
12
$ ./bcalc '2*(1+1)'
13

The last 2 are wrong. Then I found Support operating on more than two numbers on the TODO list. I think it's better to show an error message that more than 2 numbers are not supported, rather than showing wrong results. Some users could be really confused, like me! :)

@Phate6660
Copy link
Owner

Done! It will display "Only 2 numbers are supported for now." and exit with an error code of 1 if more than 2 numbers are supplied.

@Phate6660
Copy link
Owner

But something like this is high priority. There shouldn't be a 2 number restriction for too long I hope.

@adnan360
Copy link
Author

Done! It will display "Only 2 numbers are supported for now." and exit with an error code of 1 if more than 2 numbers are supplied.

Thanks.

But something like this is high priority. There shouldn't be a 2 number restriction for too long I hope.

Thanks for taking this seriously. If PEMDAS is implemented this would be a serious project to look forward to. I'll also try to implement it in my config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants