a-conjecture-of-mine

An exercise on polyglossy: the same problem solved on multiple languages

Commit
adfd52d53c6f4a6b1e0a0dd1cbf5b06f0afdf470
Parent
40b7cae777a49cbc6d369b6a003c4324a0b36cd0
Author
Gark Garcia <37553739+GarkGarcia@users.noreply.github.com>
Date

Cleaned unecessary type conversions.

Diffstat

1 file changed, 2 insertions, 2 deletions

Status File Name N° Changes Insertions Deletions
Modified src/main.rs 4 2 2
diff --git a/src/main.rs b/src/main.rs
@@ -54,12 +54,12 @@ fn main() {
 // Test the conjecture for all values up to max and return the counterexamples
 fn get_counter_expl(max : i32) -> Vec<[i32; 2]> {
     let mut counter_examples : Vec<[i32; 2]> = Vec::new();
-    let mut load_bar = 0f32;
+    let mut load_bar = 0;
 
     for a in 0..max {
 
         // Print the progress on the screen
-        let new_load_bar = ((a as f32) * 100f32 / (max as f32)).ceil();
+        let new_load_bar = a * 100 / max;
         if new_load_bar != load_bar {
             load_bar = new_load_bar;
             clear_console();