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

◆ productFitsI64()

bool fl::anonymous_namespace{device_solve.cpp.hpp}::productFitsI64 ( i64 a,
i64 b )

Does a * b fit an i64?

By division rather than by bounding the inputs, because the inputs cannot usefully be bounded here – see invert3x3Q16. Division is exact on every target and needs no builtin; __builtin_mul_overflow would be cheaper but MSVC does not have it and the host suite builds there.

Definition at line 35 of file device_solve.cpp.hpp.

35 {
36 if (a == 0 || b == 0) {
37 return true;
38 }
39 const i64 lhs = a < 0 ? -a : a;
40 const i64 rhs = b < 0 ? -b : b;
41 return rhs <= kI64Max / lhs;
42}
fl::i64 i64
Definition stdint.h:221

References fl::FL_NO_EXCEPT, kI64Max, and productFitsI64().

Referenced by productFitsI64().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: