Possible bug in the FCC calculator demo

Possible bug in the FCC calculator demo
0.0 0

#1

Phew, lots of bug testing for this one. One thing I found that could probably count as a bug (and maybe another test to be added on the calculator project) is that you should not be able to start with some operations (or I suppose it could act on the default 0 displayed). But at the moment you can press the multiply or divide buttons first, then it seems no matter what follows, the equals button will not work and you can’t do anything with the input.

This may have been done to allow starting with the subtract button for negative numbers, which does work as expected, but the multiply and divide buttons should probably not be allowed given all the other restrictions given.

Some other good tests that could be added (because a lot of projects I’ve looked at have overlooked these coding specific issues) would be dealing with JavaScript rounding problems. For example, two tests: evaluate 0.1 + 0.7 and 0.8 - 0.1 properly.


#2

Bugs should always be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.


#3

Will do, thanks! (Maybe if I’m brave I’ll look into fixing it myself.) Found another bug just now, which definitely makes me wonder how much I took for granted with the basic calculators back in elementary/high school!