NEWTON
Asked
6 months ago
3
views
0
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
0
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
end
ㅤ This answer was originally posted on Triality
answered
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