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

◆ normalizedSplitBound()

SplitBound fl::anonymous_namespace{white_allocation.cpp.hpp}::normalizedSplitBound ( i32 numerator,
i32 slope,
i32 denominator )

Fold a negative denominator into the numerator and slope, so every bound compares the same way round.

Definition at line 304 of file white_allocation.cpp.hpp.

305 {
306 SplitBound bound;
307 if (denominator < 0) {
308 bound.numerator = -numerator;
309 bound.slope = -slope;
310 bound.denominator = -denominator;
311 } else {
312 bound.numerator = numerator;
313 bound.slope = slope;
314 bound.denominator = denominator;
315 }
316 return bound;
317}
A bound on the split, as (numerator + slope * s) / denominator with a positive denominator.

References fl::anonymous_namespace{white_allocation.cpp.hpp}::SplitBound::denominator, fl::FL_NO_EXCEPT, normalizedSplitBound(), fl::anonymous_namespace{white_allocation.cpp.hpp}::SplitBound::numerator, and fl::anonymous_namespace{white_allocation.cpp.hpp}::SplitBound::slope.

Referenced by normalizedSplitBound().

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