MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / alp_decode_value

Function alp_decode_value

nodedb-codec/src/alp.rs:317–322  ·  view source on GitHub ↗
(encoded: i64, decode_exp: u8, mode: DecodeMode)

Source from the content-addressed store, hash-verified

315/// Reconstruct a single f64 from an ALP-encoded integer.
316#[inline]
317fn alp_decode_value(encoded: i64, decode_exp: u8, mode: DecodeMode) -> f64 {
318 match mode {
319 DecodeMode::MultiplyInverse => encoded as f64 * INV_POW10[decode_exp as usize],
320 DecodeMode::DivideByFactor => encoded as f64 / POW10[decode_exp as usize],
321 }
322}
323
324/// Find the best (exponent, factor_index) pair for a set of values.
325///

Callers 1

decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected