Skip to content
Standard libraryZig 0.17.0Official documentation
Sourcestd/math/big.zig

Source line 1

std.math.big.assert

alias

Source line 2

Alias of std.debug.assert

std.math.big.DoubleLimb

constant

Source line 8

std.math.big.HalfLimb

constant

Source line 9

std.math.big.int

alias

Source line 4

Alias of std.math.big.int

std.math.big.Limb

type

Source line 5

std.math.big.limb_info

constant

Source line 6

std.math.big.Log2Limb

type

Source line 11

std.math.big.SignedDoubleLimb

constant

Source line 10

std.math.big.SignedLimb

constant

Source line 7

std.math.big.std

alias

Source line 1

Alias of std

Source code

std/math/big.zig

const std = @import("../std.zig");
const assert = std.debug.assert;

pub const int = @import("big/int.zig");
pub const Limb = usize;
const limb_info = @typeInfo(Limb).int;
pub const SignedLimb = @Int(.signed, limb_info.bits);
pub const DoubleLimb = @Int(.unsigned, 2 * limb_info.bits);
pub const HalfLimb = @Int(.unsigned, limb_info.bits / 2);
pub const SignedDoubleLimb = @Int(.signed, 2 * limb_info.bits);
pub const Log2Limb = std.math.Log2Int(Limb);

comptime {
    assert(std.math.floorPowerOfTwo(usize, limb_info.bits) == limb_info.bits);
    assert(limb_info.signedness == .unsigned);
}

test {
    _ = int;
    _ = Limb;
    _ = SignedLimb;
    _ = DoubleLimb;
    _ = SignedDoubleLimb;
    _ = Log2Limb;
}