Function calcSetStringLimbCount [src]

Assumes string_len doesn't account for minus signs if the number is negative.

Prototype

pub fn calcSetStringLimbCount(base: u8, string_len: usize) usize

Parameters

base: u8string_len: usize

Source

pub fn calcSetStringLimbCount(base: u8, string_len: usize) usize { const base_f: f32 = @floatFromInt(base); const string_len_f: f32 = @floatFromInt(string_len); return 1 + @as(usize, @intFromFloat(@ceil(string_len_f * std.math.log2(base_f) / limb_bits))); }