Skip to content
Snippets Groups Projects
Commit 9fbfe1c5 authored by Daniel Friesel's avatar Daniel Friesel
Browse files

printf_float: Fix output errors caused by cast to signed int

parent 24a3921f
No related branches found
No related tags found
No related merge requests found
......@@ -178,18 +178,18 @@ void OutputStream::printf_float(float num)
num *= -1;
}
if (num > 1000) {
put('0' + (((int)num % 10000) / 1000));
put('0' + (((unsigned int)num % 10000) / 1000));
}
if (num > 100) {
put('0' + (((int)num % 1000) / 100));
put('0' + (((unsigned int)num % 1000) / 100));
}
if (num > 10) {
put('0' + (((int)num % 100) / 10));
put('0' + (((unsigned int)num % 100) / 10));
}
put('0' + ((int)num % 10));
put('0' + ((unsigned int)num % 10));
put('.');
put('0' + ((int)(num * 10) % 10));
put('0' + ((int)(num * 100) % 10));
put('0' + ((unsigned int)(num * 10) % 10));
put('0' + ((unsigned int)(num * 100) % 10));
}
// FLUSH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment