Expand description
§Arithmetic
This module defines jets that compute arithmetic functions.
Functions§
- add_8
- Add two integers and return the carry.
- add_16
- Add two integers and return the carry.
- add_32
- Add two integers and return the carry.
- add_64
- Add two integers and return the carry.
- decrement_
8 - Decrement an integer by one and return the borrow bit.
- decrement_
16 - Decrement an integer by one and return the borrow bit.
- decrement_
32 - Decrement an integer by one and return the borrow bit.
- decrement_
64 - Decrement an integer by one and return the borrow bit.
- div_
mod_ 8 - Divide the first integer by the second integer, and return the remainder.
- div_
mod_ 16 - Divide the first integer by the second integer, and return the remainder.
- div_
mod_ 32 - Divide the first integer by the second integer, and return the remainder.
- div_
mod_ 64 - Divide the first integer by the second integer, and return the remainder.
- div_
mod_ 128_ 64 - Divide the 128-bit integer
a
by the 64-bit integerb
. Return a tuple of the quotientq
and the remainerr
. - divide_
8 - Divide the first integer by the second integer.
- divide_
16 - Divide the first integer by the second integer.
- divide_
32 - Divide the first integer by the second integer.
- divide_
64 - Divide the first integer by the second integer.
- divides_
8 - Check if the first integer is divisible by the second integer.
- divides_
16 - Check if the first integer is divisible by the second integer.
- divides_
32 - Check if the first integer is divisible by the second integer.
- divides_
64 - Check if the first integer is divisible by the second integer.
- full_
add_ 8 - Add two integers. Take a carry-in and return a carry-out.
- full_
add_ 16 - Add two integers. Take a carry-in and return a carry-out.
- full_
add_ 32 - Add two integers. Take a carry-in and return a carry-out.
- full_
add_ 64 - Add two integers. Take a carry-in and return a carry-out.
- full_
decrement_ 8 - Decrement an integer by one. Take a borrow-in and return a borrow-out.
- full_
decrement_ 16 - Decrement an integer by one. Take a borrow-in and return a borrow-out.
- full_
decrement_ 32 - Decrement an integer by one. Take a borrow-in and return a borrow-out.
- full_
decrement_ 64 - Decrement an integer by one. Take a borrow-in and return a borrow-out.
- full_
increment_ 8 - Increment an integer by one. Take a carry-in and return a carry-out.
- full_
increment_ 16 - Increment an integer by one. Take a carry-in and return a carry-out.
- full_
increment_ 32 - Increment an integer by one. Take a carry-in and return a carry-out.
- full_
increment_ 64 - Increment an integer by one. Take a carry-in and return a carry-out.
- full_
multiply_ 8 - Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
- full_
multiply_ 16 - Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
- full_
multiply_ 32 - Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
- full_
multiply_ 64 - Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.
- full_
subtract_ 8 - Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
- full_
subtract_ 16 - Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
- full_
subtract_ 32 - Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
- full_
subtract_ 64 - Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.
- increment_
8 - Increment an integer by one and return the carry.
- increment_
16 - Increment an integer by one and return the carry.
- increment_
32 - Increment an integer by one and return the carry.
- increment_
64 - Increment an integer by one and return the carry.
- is_
one_ 8 - Check if an integer is one.
- is_
one_ 16 - Check if an integer is one.
- is_
one_ 32 - Check if an integer is one.
- is_
one_ 64 - Check if an integer is one.
- is_
zero_ 8 - Check if an integer is zero.
- is_
zero_ 16 - Check if an integer is zero.
- is_
zero_ 32 - Check if an integer is zero.
- is_
zero_ 64 - Check if an integer is zero.
- le_8
- Check if an integer is less than or equal to another integer.
- le_16
- Check if an integer is less than or equal to another integer.
- le_32
- Check if an integer is less than or equal to another integer.
- le_64
- Check if an integer is less than or equal to another integer.
- lt_8
- Check if an integer is less than another integer.
- lt_16
- Check if an integer is less than another integer.
- lt_32
- Check if an integer is less than another integer.
- lt_64
- Check if an integer is less than another integer.
- max_8
- Return the bigger of two integers.
- max_16
- Return the bigger of two integers.
- max_32
- Return the bigger of two integers.
- max_64
- Return the bigger of two integers.
- median_
8 - Return the median of three integers.
- median_
16 - Return the median of three integers.
- median_
32 - Return the median of three integers.
- median_
64 - Return the median of three integers.
- min_8
- Return the smaller of two integers.
- min_16
- Return the smaller of two integers.
- min_32
- Return the smaller of two integers.
- min_64
- Return the smaller of two integers.
- modulo_
8 - Compute the remainder after dividing both integers.
- modulo_
16 - Compute the remainder after dividing both integers.
- modulo_
32 - Compute the remainder after dividing both integers.
- modulo_
64 - Compute the remainder after dividing both integers.
- multiply_
8 - Multiply two integers. The output is a 16-bit integer.
- multiply_
16 - Multiply two integers. The output is a 32-bit integer.
- multiply_
32 - Multiply two integers. The output is a 64-bit integer.
- multiply_
64 - Multiply two integers. The output is a 128-bit integer.
- negate_
8 - Negate the integer (modulo 2⁸) and return the borrow bit.
- negate_
16 - Negate the integer (modulo 2¹⁶) and return the borrow bit.
- negate_
32 - Negate the integer (modulo 2³²) and return the borrow bit.
- negate_
64 - Negate the integer (modulo 2⁶⁴) and return the borrow bit.
- one_8
- Return 1 as an 8-bit integer.
- one_16
- Return 1 as a 16-bit integer.
- one_32
- Return 1 as a 32-bit integer.
- one_64
- Return 1 as a 64-bit integer.
- subtract_
8 - Subtract the second integer from the first integer, and return the borrow bit.
- subtract_
16 - Subtract the second integer from the first integer, and return the borrow bit.
- subtract_
32 - Subtract the second integer from the first integer, and return the borrow bit.
- subtract_
64 - Subtract the second integer from the first integer, and return the borrow bit.