MCPcopy Create free account
hub / github.com/BitVM/BitVM / u4_add

Function u4_add

bitvm/src/u4/u4_add.rs:219–230  ·  view source on GitHub ↗

Addition of numbers consisting of nibble_count u4's in the parameter bases locations The overflowing bit (if exists) is omitted

(
    nibble_count: u32,
    bases: Vec<u32>,
    tables_offset: u32,
    use_add_table: bool,
)

Source from the content-addressed store, hash-verified

217/// Addition of numbers consisting of nibble_count u4's in the parameter bases locations
218/// The overflowing bit (if exists) is omitted
219pub fn u4_add(
220 nibble_count: u32,
221 bases: Vec<u32>,
222 tables_offset: u32,
223 use_add_table: bool,
224) -> Script {
225 if use_add_table {
226 u4_add_with_table(nibble_count, bases, tables_offset)
227 } else {
228 u4_add_no_table(nibble_count, bases)
229 }
230}
231
232#[cfg(test)]
233mod tests {

Callers

nothing calls this directly

Calls 2

u4_add_with_tableFunction · 0.85
u4_add_no_tableFunction · 0.85

Tested by

no test coverage detected