mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
AK: Add LogStream operator<< overloads for float and double
This commit is contained in:
parent
5c780c9ef7
commit
3bbc2c7300
Notes:
sideshowbarker
2024-07-19 07:40:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3bbc2c73007
@ -181,6 +181,17 @@ void StdLogStream::write(const char* characters, int length) const
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, double value)
|
||||
{
|
||||
return stream << String::format("%.4f", value);
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, float value)
|
||||
{
|
||||
return stream << String::format("%.4f", value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -120,6 +120,11 @@ const LogStream& operator<<(const LogStream&, long long);
|
||||
const LogStream& operator<<(const LogStream&, unsigned long);
|
||||
const LogStream& operator<<(const LogStream&, unsigned long long);
|
||||
|
||||
#if !defined(KERNEL) && !defined(BOOTSTRAPPER)
|
||||
const LogStream& operator<<(const LogStream&, double);
|
||||
const LogStream& operator<<(const LogStream&, float);
|
||||
#endif
|
||||
|
||||
const LogStream& operator<<(const LogStream&, const void*);
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, char value)
|
||||
|
Loading…
Reference in New Issue
Block a user