summaryrefslogtreecommitdiff
path: root/src/os/object
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-09-23 11:45:11 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-09-23 11:45:11 +0200
commit9fbfe1c5dcb12c47e6a408818dc815e3dd856518 (patch)
tree70469a0c8192f7e4703ec83073963b10d38897a6 /src/os/object
parent24a3921f3c42b340a180f587bf5b7204ec712f85 (diff)
printf_float: Fix output errors caused by cast to signed int
Diffstat (limited to 'src/os/object')
-rw-r--r--src/os/object/outputstream.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/os/object/outputstream.cc b/src/os/object/outputstream.cc
index 4359874..fe4ec7f 100644
--- a/src/os/object/outputstream.cc
+++ b/src/os/object/outputstream.cc
@@ -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