FastLED 3.10.8
Loading...
Searching...
No Matches

◆ operator>>() [2/10]

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

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

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

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

+ Here is the call graph for this function: