MCPcopy Create free account
hub / github.com/VCVRack/Rack / chop

Function chop

include/math.hpp:145–147  ·  view source on GitHub ↗

If the magnitude of `x` if less than epsilon, return 0. */

Source from the content-addressed store, hash-verified

143
144/** If the magnitude of `x` if less than epsilon, return 0. */
145inline float chop(float x, float epsilon = 1e-6f) {
146 return std::fabs(x) <= epsilon ? 0.f : x;
147}
148
149/** Rescales `x` from the range `[xMin, xMax]` to `[yMin, yMax]`.
150*/

Callers 1

chopfFunction · 0.85

Calls 1

fabsFunction · 0.85

Tested by

no test coverage detected