Skip to main content

generate_log_table

Function generate_log_table 

Source
pub fn generate_log_table(
    small: &[[u8; 10]; 90],
    small_alt: &[[u8; 10]; 10],
) -> [[u16; 10]; 90]
Expand description

Generate the main log table: uint16[10][90].

Standard 4-figure log table layout. Row r (0-89) and column c (0-9) represent the 3-digit mantissa prefix (10+r) and third digit c, so the looked-up number is n = (10+r)100 + c10, ranging from 1000 to 9990. The stored value is the fractional part of log10(n) scaled by 10000: round((log10(n) - 3) * 10000).

ALT_TABLE_FLAG is set on entries where the small alt table provides different (more precise) mean differences than the regular small table.