From b62cc036814750572db87589ac27a2d8747c22e9 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 1 Jul 2024 15:23:27 +0900 Subject: [PATCH] fix: `I128IntoI257` --- src/alexandria/i257.cairo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/alexandria/i257.cairo b/src/alexandria/i257.cairo index dbbce8d..b6330cc 100644 --- a/src/alexandria/i257.cairo +++ b/src/alexandria/i257.cairo @@ -354,7 +354,7 @@ impl U256IntoI257 of Into { impl I128IntoI257 of Into { fn into(self: i128) -> i257 { if self < 0 { - let abs: u128 = self.try_into().unwrap(); + let abs: u128 = (-self).try_into().unwrap(); i257 { abs: abs.into(), is_negative: true } } else { let abs: u128 = self.try_into().unwrap();