Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "cubit"
version = "1.3.0"
cairo-version = ">=2.4.0"
cairo-version = "2.6.3"
edition = "2023_10"
description = "Math library in Cairo using a 64.64 fixed point representation"
homepage = "https://github.com/influenceth/cubit"

[lib]
sierra = false # Enable Sierra codegen.
casm = false # Enable CASM codegen.
sierra = true # Enable Sierra codegen.
casm = true # Enable CASM codegen.

[dependencies]
8 changes: 4 additions & 4 deletions src/f128/types/fixed.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -551,7 +551,7 @@ impl FixedOne of core::num::traits::One<Fixed> {
}
#[inline(always)]
fn is_one(self: @Fixed) -> bool {
*self == FixedOne::one()
*self == Self::one()
}
#[inline(always)]
fn is_non_one(self: @Fixed) -> bool {
Expand Down
6 changes: 3 additions & 3 deletions src/f64/types/fixed.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -548,7 +548,7 @@ impl FixedOne of core::num::traits::One<Fixed> {
}
#[inline(always)]
fn is_one(self: @Fixed) -> bool {
*self == FixedOne::one()
*self == Self::one()
}
#[inline(always)]
fn is_non_one(self: @Fixed) -> bool {
Expand Down