utils
Felt Utilities
Utility functions for working with signed felt252 values using
sign-magnitude representation.
Functions
felt_sign- Determine the sign of a felt valuefelt_abs- Get the absolute value of a felt
Fully qualified path: cairo_fp::utils
Constants
| HALF_PRIME | Half of the prime field modulus. Used as the boundary between positive and negative values in sign-magnitude representation. Values above this are negative. |
Free functions
| felt_sign | Returns the sign of a signed felt252 . Uses sign-magnitude representation where values greater than HALF_PRIME are considered negative…. |
| felt_abs | Returns the absolute value of a signed felt252 . If the value is negative (per sign-magnitude representation), returns its negation. Otherwise returns the value unchanged. |