THE BEST CALCULATOR ON REPL.IT *not clickbait*
Finally, this took SO MUCH effort. FINALLY IT WORKS.
I present to the repl.it community:
The best calculator I have ever seen on repl.it (so the title could potentially have been clickbait unintentionally, I have not been around for that long...). Following a trio of connected calculators:
- C++, by @FlaminHotValdez
- Python, by @IntellectualGuy
- HTML, CSS, JS, by @henryeth (yes me)
This excels them all in all areas. The closest one is Valdez's C++ one but this is far smaller and more efficient, as well as supporting a couple more operators. Do your worst - if you do find a bug, please PLEASE let me know in the comments, I really want this flawless. It will be harder to abuse than Valdez's (I saw what you community did to that comment section) because it will should ignore any invalid characters or valid characters in invalid positions. However, obviously, integer limit is still a problem :braces himself for upcoming abuse of calculator:. Any questions or suggestions (preferably questions) please write them in the comments.
P.S: Please work calculator PLEASE.
Thank you all so much this is by far the most cycles I have ever had!
I saw what you community did to that comment section
I love this community so much.
It also doesn't seem to run negative numbers.
It seems that parentheses don't work.
Nice calculator. If I was doing this I would just eval()
it 😁
also to beat mine. yes I'm salty
good job!
You: "If I was doing this I would just eval()
it
Also you: makes a legitimate calculator without using eval()
🤣 Well I didn't want to be an @AJK4 because it would bring no value to the community.
finally, you got a ton of cycles
@henryeth! And the code is sooooooooo complicated that....(what is the append thing over there? what are - char, and other crazy stuff?)The code is sooooo simple(not to be mean)
@CaptinNeolmfao
SIR 66X0 IS NOT 660
I typed in 2+2/2x2 and it said the answer is 2.090909090909091.
i got infinity!
On Valdez's Calculator:
On your calculator:
Quoting Coder100, "ah yes, math".
(No hate, ngl. I could never do this without eval()
!)
I don't know why, but % don't work, it doesn't say invalid input, it will break.
now this is impressive python coding
np you deserve it! I would not be able to do this in python even back when I used to use it, I was worried to click on this cause i thought it would be another eval statement, but I was very wrong, this is just awesome
@henryethprint(eval(input("Nter th xpreson")))
yea lol, even CC did that once
@henryethcoding cactus
@FlaminHotValdezwow, keep it up dude!
@henryethreally good, minor suggestion, make it a loop to keep going like my calculator.
hi, im currently making a calculator that does, well everything and I could use some more help
this should equal 1 or 16???
You can't use variables :trololololo:
:(
Does this using the shunting-yard algorithm? It certainly looks so.
CANNOT HANDLE SQUARE ROOTS!
it didnt work >:0
Put -69*69/420
The answer should be negative, returns POSITIVE
Put 4^-0.5
The nnswer should be 0.5. Instead returns the number if the exponent were POSITIVE (this is, 0.5), returning TWO.
You shouldn´t be SO POSITIVE with your calculator, SIR HENRY.
Or, you could just like do this: print(eval(input("Enter you expression: ")))
since python can do math
Plugging in a user input to
eval
without making sure it is an equation first can let people read/write/create files, which is very bad.If you inspect the code here, you can see how it won't run the
eval
if it's not an equation.i tried to do quik mafs
You should make a ans option, so you can use your past answer as a number
One thing that could be improved on is floating-point math. It is hard for base-2 computers to do simple things like add 0.1 and 0.2, but you could try a workaround, like multiplying the float until it is an int.
when you are using this (For example it says 5 plus 5 = 55) Could you please fix this.
Overall nice calculator.
@henryeth - it cannot handle imaginary numbers (3 + 2i^2 etc.). However, imaginary numbers are a key area in algebra, so this can be called a major error.However, I have found an error in your calculator
Another graphical problem (an extra dot in the end):
It can also be improved by adding equation solvers with variables, like the online calculator https://www.symbolab.com/ of wolfram alpha.
and second, note the "that I have seen". Even excluding the second point as it is kind of cheaty, try and find me a better calculator that matches the first point on repl.it, or, even better, make one yourself. I would be quite happy to be educated on the matter...
As for finding a better calculator, I take you up on that challenge. emilian1000000's calculator (https://repl.it/@emilian1000000/Mega-Calculator) can be seen as better because of the average command as well as calculations on '<' and '>'.
gotemIt's going to be really hard, as you will have to parse the variables as well as other concepts in algebra.
Expect no less than 500 lines of code for something as complicated than that...
is it really a good calculator without making a programming language?
@KnightsOfAzgardhm that one isn't working very well at all

@KnightsOfAzgard1e+10
is the same as10000000000
.