Skip to content
Snippets Groups Projects
Commit cf31570d authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

outputstream: Add << for float and double

parent 276b9a93
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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;
......
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