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

Function u4_add_with_table

bitvm/src/u4/u4_add.rs:200–206  ·  view source on GitHub ↗

Addition of numbers consisting of nibble_count u4's in the parameter bases locations Requires the addition table and tables_offset to locate the table which should be equal to number of elements on top of the table including operating values

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

Source from the content-addressed store, hash-verified

198/// Addition of numbers consisting of nibble_count u4's in the parameter bases locations
199/// Requires the addition table and tables_offset to locate the table which should be equal to number of elements on top of the table including operating values
200pub fn u4_add_with_table(nibble_count: u32, bases: Vec<u32>, tables_offset: u32) -> Script {
201 let numbers = bases.len() as u32;
202 script! {
203 { u4_arrange_nibbles(nibble_count, bases) }
204 { u4_add_internal(nibble_count, numbers, tables_offset) }
205 }
206}
207
208/// Addition of numbers consisting of nibble_count u4's in the parameter bases locations, without the table
209pub fn u4_add_no_table(nibble_count: u32, bases: Vec<u32>) -> Script {

Callers 2

u4_addFunction · 0.85
test_calcFunction · 0.85

Calls 1

lenMethod · 0.80

Tested by 1

test_calcFunction · 0.68