Skip to main content

cast_num

Function cast_num 

Source
fn cast_num(ty: ElementaryType, value: Num) -> Option<Num>
Expand description

Reinterprets a folded value for an elementary type cast used inside a larger expression, applying the target width so truncation and sign-extension are correct (e.g. int256(uint256(type(uint256).max)) -> -1).