Function cairo_vm::math_utils::signed_felt

source ·
pub fn signed_felt(felt: Felt252) -> BigInt
Expand description

Converts Felt252 into a BigInt number in the range: (- FIELD / 2, FIELD / 2).

§Examples

let positive = Felt252::from(5);
assert_eq!(signed_felt(positive), BigInt::from(5));

let negative = Felt252::MAX;
assert_eq!(signed_felt(negative), BigInt::from(-1));