Commit cf31570d authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

outputstream: Add << for float and double

parent 276b9a93
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
+12 −0
Original line number Diff line number Diff line
@@ -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;