Closed MarcDirven closed 3 years ago
Correct, printing doubles is not implemented. It would be a considerable effort. In general, using float/double on small embedded systems (without hardware floating point support) is not a good idea (slow, code bloat).
Then I'd suggest at least putting a static_assert
message in there because at the time (Sept - 2018), I was very confused. This can be easily be done using:
template<class>
struct AlwaysFalse : std::false_type {};
template<class F = std::enable_if_t<std::is_floating_point<F>::value, int> = 0>
friend ostream & operator<< ( ostream & stream, F ) {
static_assert(AlwaysFalse<F>::value, "hwlib doesn't support outputting floating point values");
}
When trying to cout doubles, the following message appears: