FastLED 3.9.15
Loading...
Searching...
No Matches

◆ operator>>() [2/10]

istream_real & fl::istream_real::operator>> ( double & d)

Definition at line 319 of file istream.cpp.

319 {
320 string token;
321 if (readToken(token)) {
322 // Use the existing toFloat() method
323 float f = token.toFloat();
324 d = static_cast<double>(f);
325 // Check if parsing was successful (same logic as float)
326 if (ALMOST_EQUAL_FLOAT(f, 0.0f) && token != "0" && token != "0.0" && token != "0." && token.find("0") != 0) {
327 failed_ = true;
328 }
329 } else {
330 failed_ = true;
331 }
332 return *this;
333}
bool readToken(string &token)
Definition istream.cpp:173
#define ALMOST_EQUAL_FLOAT(a, b)
Definition math_macros.h:63

References istream_real(), ALMOST_EQUAL_FLOAT, failed_, fl::StrN< SIZE >::find(), readToken(), and fl::StrN< SIZE >::toFloat().

+ Here is the call graph for this function: