FastLED 3.10.6
Loading...
Searching...
No Matches

◆ operator>>() [2/10]

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

Definition at line 320 of file istream.cpp.hpp.

320 {
321 string token;
322 if (readToken(token)) {
323 // Use the existing toFloat() method
324 float f = token.toFloat();
325 d = static_cast<double>(f);
326 // Check if parsing was successful (same logic as float)
327 if (fl::almost_equal(f, 0.0f) && token != "0" && token != "0.0" && token != "0." && token.find("0") != 0) {
328 mFailed = true;
329 }
330 } else {
331 mFailed = true;
332 }
333 return *this;
334}
bool readToken(string &token)
constexpr bool almost_equal(T a, T b, U tolerance) FL_NO_EXCEPT
Definition math.h:90

References istream_real(), fl::almost_equal(), fl::basic_string::find(), mFailed, readToken(), and fl::basic_string::toFloat().

+ Here is the call graph for this function: