Skip to content

➗ Zig port of the QuickDiv divisor optimized for repeated division and modulo operations created by @dtrifuno.

License

Notifications You must be signed in to change notification settings

tensorush/zig-quickdiv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦎 ➗ zig quickdiv

CI CD DC CC LC

Zig port of the QuickDiv library created by Darko Trifunovski.

🚀 Usage

  1. Add quickdiv as a dependency in your build.zig.zon.

    build.zig.zon example
    .{
        .name = "<name_of_your_package>",
        .version = "<version_of_your_package>",
        .dependencies = .{
            .quickdiv = .{
                .url = "https://github.com/tensorush/zig-quickdiv/archive/<git_tag_or_commit_hash>.tar.gz",
                .hash = "<package_hash>",
            },
        },
        .paths = .{
            "src/",
            "build.zig",
            "README.md",
            "LICENSE.md",
            "build.zig.zon",
        },
    }

    Set <package_hash> to 12200000000000000000000000000000000000000000000000000000000000000000 and build your package to find the correct value specified in a compiler error message.

  2. Add quickdiv as a module in your build.zig.

    build.zig example
    const quickdiv = b.dependency("quickdiv", .{});
    lib.root_module.addImport("quickdiv", quickdiv.module("quickdiv"));