absolute Helper¶
-
template<size_t MaxDeps = 8, typename Source>
auto RxESP32::Helpers::Numerical::absolute(Source &source, const typename Computed<decltype(source.get()), 1, MaxDeps>::Options &options = {})¶ Get absolute value of source.
Creates a Computed that returns the absolute value of the source.
- Since
v0.1.0
Signal<int> value(-42); auto abs_value = absolute(value); Serial.println(abs_value.get()); // 42 value.set(10); Serial.println(abs_value.get()); // 10Warning
Only accepts arithmetic types (integral and floating-point).
See Also¶
Numerical Helpers - Overview