https://github.com/desktopgame/zig-calc
simple calcuulator written in zig
https://github.com/desktopgame/zig-calc
zig ziglang
Last synced: 6 months ago
JSON representation
simple calcuulator written in zig
- Host: GitHub
- URL: https://github.com/desktopgame/zig-calc
- Owner: desktopgame
- Created: 2024-08-21T14:25:22.000Z (almost 2 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-24T05:02:11.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T18:15:01.587Z (over 1 year ago)
- Topics: zig, ziglang
- Language: Zig
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# zig-calc
zig-calc is simple calculator, written in zig.
only basic arithmetic operations, constant, and function supported.
# example
````
zig build run -- 3 + 4
> 7
zig build run -- 12 + (3 * 4)
> 24
zig build run -- -3 * 2
> -6
zig build run -- 5 + (-3)
> 2
zig build run -- max(1,2)
> 2
zig build run -- min(1,2)
> 1
zig build run -- avg(4,4,4,4)
> 4
````
When used from Powershell, enclose the parentheses in double quotation marks.
````
zig build run -- "5 + (-3)"
> 2
````