Results for “max”
Small, practical examples. Search by task or narrow things down below.
Keep a counter from wrapping at its maximum
Arduino / C: Increment only when the value is below its limit.
Arduino / C✓ Tested
Limit typed text to a maximum length
HTML: Maxlength limits ordinary user editing without replacing server-side validation.
HTML✓ Tested
Return all rows tied for the maximum in a group
SQL: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQL✓ Tested
Return all rows tied for the maximum in a group
SQL Server: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQL Server✓ Tested
Return all rows tied for the maximum in a group
Postgres: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
Postgres✓ Tested
Return all rows tied for the maximum in a group
SQLite: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.
SQLite✓ Tested
Cap a box’s width
CSS: Max-width constrains an otherwise larger declared width.
CSS✓ Tested
Clamp a value to an allowed interval
Clamp a value to an allowed interval using a complete Go program with explicit sample inputs.
Go✓ Tested
Find a sample range in one pass
Arduino / C: Initialize extrema from the first element of a nonempty array.
Arduino / C✓ Tested
Find both extremes in one algorithm call
C++: Check for a nonempty input before dereferencing the returned iterators.
C++✓ Tested
Find the largest array value
Track the maximum in a nonempty C integer array.
C✓ Tested
Find the largest value
Check for an empty C++ vector before dereferencing max_element.
C++✓ Tested