Skip to content

Commit

Permalink
runtime: change usize to i128 cause -numbers exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiserthe13th committed Oct 23, 2021
1 parent ac04a2b commit 841e131
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/runtime/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl std::fmt::Debug for Object {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Sayı(n) => {
if n == &((*n as usize) as f64) {
if n == &((*n as i128) as f64) {
write!(f, "{:.0?}", n)
} else {
write!(f, "{:?}", n)
Expand Down Expand Up @@ -189,8 +189,8 @@ impl Object {
match a {
Self::Sayı(a) => {
let mut buf = String::new();
if a == (a as usize) as f64 {
for _ in 0..(a as usize) {
if a == (a as i128) as f64 {
for _ in 0..(a as i128) {
buf.push_str(s.as_str())
}
} else {
Expand All @@ -208,8 +208,8 @@ impl Object {
},
Self::Yazı(s) => {
let mut buf = String::new();
if f == &((*f as usize) as f64) {
for _ in 0..(*f as usize) {
if f == &((*f as i128) as f64) {
for _ in 0..(*f as i128) {
buf.push_str(s.as_str())
}
} else {
Expand Down

0 comments on commit 841e131

Please sign in to comment.