summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/object/outputstream.h2
-rw-r--r--src/os/object/outputstream.cc12
2 files changed, 14 insertions, 0 deletions
diff --git a/include/object/outputstream.h b/include/object/outputstream.h
index 4a37977..70ebece 100644
--- a/include/object/outputstream.h
+++ b/include/object/outputstream.h
@@ -35,6 +35,8 @@ class OutputStream {
OutputStream & operator<<(long long number);
OutputStream & operator<<(void *pointer);
OutputStream & operator<<(const char *text);
+ OutputStream & operator<<(float number);
+ OutputStream & operator<<(double number);
OutputStream & operator<<(OutputStream & (*fun) (OutputStream &));
void setBase(uint8_t b);
diff --git a/src/os/object/outputstream.cc b/src/os/object/outputstream.cc
index 31b0da4..f257fa5 100644
--- a/src/os/object/outputstream.cc
+++ b/src/os/object/outputstream.cc
@@ -98,6 +98,18 @@ OutputStream & OutputStream::operator<<(long long number)
return *this;
}
+OutputStream & OutputStream::operator<<(double number)
+{
+ *this << (float)number;
+ return *this;
+}
+
+OutputStream & OutputStream::operator<<(float number)
+{
+ this->printf_float(number);
+ return *this;
+}
+
OutputStream & OutputStream::operator<<(void *pointer)
{
unsigned short temp_base = base;