Skip to main content

convbase_ptr

Function convbase_ptr 

Source
pub fn convbase_ptr(v: i64, base: i32) -> (String, i32)
Expand description

Port of convbase_ptr(char *s, zlong v, int base, int *ndigits) from Src/params.c:5586. C body converts v into base base (negative base suppresses the “0x”/“N#” discriminator), writing the digits into s and returning the digit count via *ndigits. Rust port returns (formatted_string, digit_count) since Rust strings own their buffer. WARNING: param names don’t match C — Rust=(v, base) vs C=(s, v, base, ndigits)