Skip to content

alpertron/calculators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

37b115b · Apr 27, 2024Apr 27, 2024
Apr 5, 2024
Apr 19, 2020
Oct 1, 2022
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 13, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
May 21, 2023
Apr 19, 2020
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
May 28, 2023
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Apr 27, 2024
Jan 28, 2024
Mar 2, 2024
May 12, 2023
Jun 2, 2023
Apr 27, 2024
Mar 30, 2023
Feb 26, 2023
Apr 15, 2024
Apr 15, 2024
Apr 13, 2024
May 12, 2023
Jan 29, 2024
Apr 18, 2024
Jun 3, 2023
Jan 28, 2024
Apr 1, 2023
Mar 2, 2022
Apr 1, 2023
Mar 2, 2024
Mar 2, 2024
Nov 20, 2023
Jan 25, 2019
Mar 16, 2021
Mar 16, 2021
Nov 6, 2017
Nov 6, 2017
Mar 22, 2024
Oct 1, 2022
Jun 2, 2022
Jun 2, 2023
Apr 21, 2024
Apr 27, 2024
Jul 17, 2023
Oct 16, 2022
Oct 1, 2022
Jun 2, 2022
Jun 2, 2022
Apr 21, 2024
Oct 21, 2022
Mar 2, 2022
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Mar 22, 2024
Apr 27, 2024
Oct 1, 2022
Jun 2, 2022
Mar 2, 2022
Apr 18, 2024
Apr 1, 2023
Oct 1, 2022
Oct 1, 2022
Nov 13, 2022
Mar 22, 2024
Jan 25, 2019
Aug 23, 2017
Aug 23, 2017
Aug 23, 2017
Sep 2, 2017
Jan 28, 2024
Oct 1, 2022
Jun 2, 2022
Jan 29, 2024
Jan 29, 2024
Oct 1, 2022
Jun 2, 2022
Apr 27, 2024
Apr 22, 2024
May 12, 2023
Jul 16, 2022
Oct 1, 2022
Apr 15, 2024
Apr 27, 2024
Apr 15, 2024
Apr 21, 2024
Apr 21, 2024
Oct 1, 2022
Jun 2, 2022
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Jan 28, 2024
Oct 1, 2022
Jun 2, 2022
Feb 14, 2024
Apr 5, 2024
Jun 28, 2021
Apr 27, 2024
Oct 1, 2022
Jun 2, 2022
Jul 28, 2023
Jul 16, 2022
May 14, 2023
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Feb 27, 2024
Oct 1, 2022
Jun 2, 2022
Oct 1, 2022
Jun 2, 2022
Mar 22, 2024
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Mar 22, 2024
Oct 1, 2022
Jun 2, 2022
Jun 2, 2023
Apr 3, 2023
Oct 1, 2022
May 21, 2023
Apr 19, 2020
Feb 24, 2023
Jun 2, 2023
Mar 2, 2022
Mar 2, 2022
Mar 2, 2022
Mar 22, 2024
Jul 20, 2021
Apr 18, 2024
May 12, 2023
Apr 27, 2024
Jun 4, 2023
Jun 2, 2023
Nov 13, 2022
Jul 16, 2022
Jul 10, 2022
Apr 4, 2024
Jun 29, 2021
Apr 25, 2021
Apr 27, 2024
Oct 1, 2022
Jun 2, 2022
Feb 26, 2023
Apr 13, 2024
Nov 13, 2022
May 3, 2022
Jul 20, 2021
Jul 12, 2022
Jul 28, 2023
Mar 22, 2024
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Apr 27, 2024
Oct 1, 2022
Jun 2, 2022
Apr 4, 2024
Apr 27, 2024
Apr 4, 2024
Apr 13, 2024
Apr 27, 2024
Jul 17, 2022
Oct 1, 2022
Jan 25, 2019
Oct 28, 2018
Oct 28, 2018
Oct 28, 2018
Oct 28, 2018
Apr 4, 2024
Oct 1, 2022
Jun 2, 2022
Jan 25, 2019
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Nov 6, 2017
Jan 28, 2024
Oct 1, 2022
Jun 2, 2022
Aug 4, 2023
Apr 30, 2022
May 12, 2023
Apr 18, 2024
Apr 4, 2024
Apr 18, 2024
Apr 4, 2024
Apr 4, 2024
Feb 13, 2022
Feb 13, 2022
Jan 28, 2024
Apr 4, 2024
Apr 4, 2024
Feb 11, 2024
Jan 28, 2024
Feb 25, 2023
May 14, 2023
Apr 20, 2021
Oct 20, 2022
Mar 2, 2022
Sep 11, 2022
Feb 24, 2023
Mar 22, 2024
Jun 2, 2022
Jun 2, 2022
Sep 11, 2022
Apr 27, 2024
Sep 11, 2022
Sep 11, 2022
Sep 11, 2022
Sep 11, 2022
Sep 11, 2022
Feb 27, 2024
Oct 1, 2022
Sep 11, 2022
Feb 3, 2024
Feb 3, 2024
Jun 4, 2023
Apr 3, 2023
Oct 1, 2022
Oct 24, 2022
Jan 28, 2024
Jun 2, 2023
Feb 14, 2024
Jan 29, 2024
Jan 29, 2024
May 13, 2023

Repository files navigation

I have written 14 calculators in my free time. Their source code is open source, so you can use the code for your own projects.

I started writing these calculators as Java applets in 1997. In 2015 I ported them to C language. The code is compiled to WebAssembly or asm.js using Emscripten so it can run inside Web browsers.

The complete source code size is about 70 000 lines of code.

Running the programs as standalone executables

The main purpose of compiling the code is to run coverage tests. The file coverage.out.old holds the results of running all calculators with different inputs. After making a change in the code, I run this test again and the output should not be changed. When adding a new feature to the calculators, I add the new case to the coverage, and change the results file if the results are correct. These tests use the files Makefile and coverage.

You can use Makefile to generate standalone executables. Just run make clean and then make. If you want to build only one of the calculators, you can run make calculator, where calculator is one of the following words:

After building the calculators, you can run them. For example:

./polfact 0 "x^2+x+3" 2

The output is in HTML and it starts with a digit (this is used by the JavaScript code). All calculators can process expressions.

If you run the calculator without command line parameters, the program will show the expected arguments.

Static code analysis

Software quality assurance is realized with the coverage test explained in the previous section and static analysis. The latter is done by tools that scan the source code. The programs do not run in this case.

Results of static analysis and code coverage of this software using Codacy.

Badges from SonarCloud:

Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Quality Gate Status Reliability Rating Security Rating Technical Debt Vulnerabilities

If you like these calculators and you want to support free software, you can donate via Paypal by clicking in the button below:

paypal