FIND YOUR NEXT FEW LINES

Results for “on”

Small, practical examples. Search by task or narrow things down below.

3000 snippets foundClear filters
Arduino / CGetting Started

Choose the smaller of two values

Arduino / C: Choose the smaller of two values on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
CSSPositioning & stacking

Choose which overlapping box receives a pointer

CSS: Z-index controls the stack level of these positioned sibling elements.

CSS✓ Tested
JavaScriptNumbers & numeric validation

Clamp a number between inclusive bounds

JavaScript: Combine Math.min and Math.max when lower is no greater than upper.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Clamp a number between inclusive bounds

TypeScript: Combine Math.min and Math.max when lower is no greater than upper.

TypeScript✓ Tested
RustNumbers & durations

Clamp a number to a valid interval

Clamp a number to a valid interval in a complete Rust program using the standard library.

Rust✓ Tested
C#Dates & precise numbers

Clamp a number to inclusive bounds

C#: Math.Clamp returns the nearest endpoint when the value lies outside the range.

C#✓ Tested
PowerShellDates & numeric validation

Clamp a number to inclusive bounds

PowerShell: Math.Clamp chooses the nearest endpoint for an out-of-range value.

PowerShell✓ Tested
Bash ScriptsText parsing & arithmetic

Clamp a numeric setting to a valid range

Bash Scripts: Use arithmetic comparisons before applying a user-supplied bounded setting.

Bash Scripts✓ Tested
PythonNumbers & calculations

Clamp a numeric value between bounds

Python: Combine min and max for a closed interval when lower is no greater than upper.

Python✓ Tested
C++Numbers & algorithms

Clamp a value to a range

Use C++17 clamp to bound a numeric value.

C++✓ Tested
GoTesting & reusable helpers

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
CNumeric parsing & arithmetic

Clamp an integer to inclusive bounds

C: Explicit comparisons avoid relying on nonstandard min or max macros.

C✓ Tested