Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

log10Alloc

Public Function
std.math.big.int.Const.log10Alloc
pub fn log10Alloc(a: Const, allocator: Allocator) Allocator.Error!Limb

Calculate the base 10 logarithm, rounded down.

The allocator is used to allocate a temporary buffer.

Params

File

math/big/int.zig:2754
2754
2755
2756
2757
2758
2759
    pub fn log10Alloc(a: Const, allocator: Allocator) Allocator.Error!Limb {
        const limbs_buffer = try allocator.alloc(Limb, calcLog10LimbsBufferLen(a.limbs.len));
        defer allocator.free(limbs_buffer);

        return a.log10(limbs_buffer);
    }