min()

Math / Calculation

Description

Determines the smallest value in a sequence of numbers. Supports two or three arguments.

Syntax

float min(float a, float b) float min(float a, float b, float c)

Parameters

NameTypeDescription
afloatfirst value
bfloatsecond value
cfloatthird value (optional)

Returns

float

Related

Under the Hood

From Processing.h:

int min() const { if (data.empty()) throw std::runtime_error("Cannot use min() on an empty IntList."); return *std::min_element(data.begin(), data.end()); } float min() const { if (data.empty()) throw std::runtime_error("Cannot use min() on an empty FloatList."); return *std::min_element(data.begin(), data.end()); } static float min(float a,float b) { return a<b?a:b; } static float min(float a,float b,float c) { float m=a<b?a:b; return m<c?m:c; }