Math expression solving library
Go to file
2023-12-26 00:28:46 +06:00
src fixed bugs 2023-12-26 00:28:46 +06:00
.gitignore removed vscode settings file 2023-12-19 22:00:21 +06:00
build_c.sh chmod 2023-12-25 21:37:57 +06:00
build_cs.sh chmod 2023-12-25 21:37:57 +06:00
FusionCalculator.csproj build scripts 2023-12-22 22:43:08 +06:00
FusionCalculator.exe.csproj build scripts 2023-12-22 22:43:08 +06:00
README.md Created README.md 2023-12-22 23:59:52 +06:00

FusionCalculator

The calculator written in Fusion language. Can be translated to C and C#. Can be compiled as executable or library.

Building

Requirements: fut, bash, dotnet8 (for c#), gcc (for C)

Just generate C# source files:

./build_cs.sh --translate-only

Build C# executable:

./build_cs.sh

Build C executable:

./build_c.sh

Build C executable with debug symbols:

./build_c.sh --debug

Executable usage

Just call exe file in bin/ with math expression arguments:

bin/FusionCalculator.exe 1+2
3
bin/FusionCalculator.exe '11/(99-88)'
1
bin/FusionCalculator.exe '-1+6*(-2)'
-13

Library usage

The public interface is very simple:

namespace FusionCalculator {
  public static class Calculator {
    public static double Calculate(string);
  }
}

Just call Calculate and get the result!