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

Function u4_add_nested

bitvm/src/u4/u4_add.rs:121–134  ·  view source on GitHub ↗

Calculates the modulo 16 of the u4 at the top of the stack, parameters being internal values

(current: u32, limit: u32)

Source from the content-addressed store, hash-verified

119
120/// Calculates the modulo 16 of the u4 at the top of the stack, parameters being internal values
121pub fn u4_add_nested(current: u32, limit: u32) -> Script {
122 script! {
123 OP_DUP
124 OP_16
125 OP_GREATERTHANOREQUAL
126 OP_IF
127 OP_16
128 OP_SUB
129 if current + 1 < limit {
130 { u4_add_nested(current + 1, limit)}
131 }
132 OP_ENDIF
133 }
134}
135
136/// Addition of zipped numbers consisting of nibble_count u4's, without the table
137pub fn u4_add_no_table_internal(nibble_count: u32, number_count: u32) -> Script {

Callers 1

u4_add_nibble_stackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected