6 months ago
What is the best way to check if a value is less than another value in a conditional? Say if x > y, then do something
ㅤ This question was originally posted on Triality
For less than or equal use the following:
Make sure you import
from starkware.cairo.common.math_cmp import is_le
and then you can use the following statement
let (isLe) = is_le(0, 1)
#if the first value is less than or equal to the second then you get 1, if first value is greater than the second you get 0.
if isLe == 1:
#Do something for a less than or equal scenario
ㅤ This answer was originally posted on Triality
7 months ago
Are you able to nest mappings in Cairo like you can in Solidity?
storage for array
Which lib can help me to make a multicall in JS for StarkNet?
How to get the contract ABI using Starknet.Py?
Is there a unsigned_div_rem supporting dividing by 2**128 ?
How do I connect my DAPP to a private Starknet network using starknetjs?
a pointer with a hint, without doing a memory allocation