From 0d3abe8e42893fa0a174ea83b6e95925f14232c9 Mon Sep 17 00:00:00 2001 From: sofia Date: Wed, 23 Jul 2025 21:18:38 +0300 Subject: [PATCH] Fix add_num_to_string not printing 10 --- examples/loops.reid | 2 +- reid/lib/std.reid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/loops.reid b/examples/loops.reid index 409de52..931f086 100644 --- a/examples/loops.reid +++ b/examples/loops.reid @@ -6,7 +6,7 @@ import std::add_num_to_str; import std::free_string; fn main() -> u32 { - for i in 0 .. 5 { + for i in 0 .. 15 { let mut text = new_string(); add_num_to_str(&mut text, i); print(&text); diff --git a/reid/lib/std.reid b/reid/lib/std.reid index 62a9dff..2b761be 100644 --- a/reid/lib/std.reid +++ b/reid/lib/std.reid @@ -93,7 +93,7 @@ fn str_length(string: *char, position: u32) -> u32 { } pub fn add_num_to_str(string: &mut String, num: u64) { - if num > 10 { + if num >= 10 { add_num_to_str(string, num / 10) } let rem = num % 10;