diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..f239fe2 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +scarb 2.6.3 diff --git a/Scarb.toml b/Scarb.toml index 8321422..4e36ecd 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -1,7 +1,7 @@ [package] name = "cubit" version = "1.3.0" -cairo-version = ">=2.4.0" +cairo-version = ">=2.6.0" edition = "2023_10" description = "Math library in Cairo using a 64.64 fixed point representation" homepage = "https://github.com/influenceth/cubit" diff --git a/src/f128/types/fixed.cairo b/src/f128/types/fixed.cairo index e3f2bd7..f8d3103 100644 --- a/src/f128/types/fixed.cairo +++ b/src/f128/types/fixed.cairo @@ -92,16 +92,16 @@ impl FixedImpl of FixedTrait { } fn new_unscaled(mag: u128, sign: bool) -> Fixed { - return FixedTrait::new(mag * ONE_u128, sign); + return Self::new(mag * ONE_u128, sign); } fn from_felt(val: felt252) -> Fixed { let mag = core::integer::u128_try_from_felt252(utils::felt_abs(val)).unwrap(); - return FixedTrait::new(mag, utils::felt_sign(val)); + return Self::new(mag, utils::felt_sign(val)); } fn from_unscaled_felt(val: felt252) -> Fixed { - return FixedTrait::from_felt(val * ONE); + return Self::from_felt(val * ONE); } fn abs(self: Fixed) -> Fixed { @@ -551,7 +551,7 @@ impl FixedOne of core::num::traits::One { } #[inline(always)] fn is_one(self: @Fixed) -> bool { - *self == FixedOne::one() + *self == Self::one() } #[inline(always)] fn is_non_one(self: @Fixed) -> bool { diff --git a/src/f64/types/fixed.cairo b/src/f64/types/fixed.cairo index 5e4ef81..85dee51 100644 --- a/src/f64/types/fixed.cairo +++ b/src/f64/types/fixed.cairo @@ -93,11 +93,11 @@ impl FixedImpl of FixedTrait { fn from_felt(val: felt252) -> Fixed { let mag = core::integer::u64_try_from_felt252(utils::felt_abs(val)).unwrap(); - return FixedTrait::new(mag, utils::felt_sign(val)); + return Self::new(mag, utils::felt_sign(val)); } fn from_unscaled_felt(val: felt252) -> Fixed { - return FixedTrait::from_felt(val * ONE.into()); + return Self::from_felt(val * ONE.into()); } fn abs(self: Fixed) -> Fixed { @@ -548,7 +548,7 @@ impl FixedOne of core::num::traits::One { } #[inline(always)] fn is_one(self: @Fixed) -> bool { - *self == FixedOne::one() + *self == Self::one() } #[inline(always)] fn is_non_one(self: @Fixed) -> bool {