https://github.com/brianferri/zig-fib
https://github.com/brianferri/zig-fib
fibonacci-sequence
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brianferri/zig-fib
- Owner: brianferri
- Created: 2025-04-15T13:56:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-09T16:42:58.000Z (10 months ago)
- Last Synced: 2025-09-09T20:00:55.927Z (10 months ago)
- Topics: fibonacci-sequence
- Language: Zig
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zig-fib
Zig implementation of [Fibsonisheaf](https://github.com/SheafificationOfG/Fibsonisheaf/)
## Build && run
> [!NOTE]
> Default (if not specified) will be the `naive` implementation
```sh
zig build -Doptimize=ReleaseFast -Dimplementation=linear run
```
> using `Debug` mode will not work as it has safety measures against integer overflows, which have yet to be patched
You may also calculate a single fibonacci number by passing it's index as an argument
```sh
zig build -Doptimize=ReleaseFast -Dimplementation=fastexp run -- 4000000
```
## Inspecting assembly
```sh
zig build -Doptimize=ReleaseFast -Dimplementation=linear asm
```
will generate a `[implementation]_[optimize].s` file under `zig-out/asm`
## Flags
some additional flags you may use are:
| Flag | Description |
| ---------------------- | --------------------------------- |
| -Dprint_numbers=[bool] | print the numbers in the output |
| -Duse_csv_fmt=[bool] | print the output using csv format |