Results for “int”
Small, practical examples. Search by task or narrow things down below.
Clone inert template content into the document
HTML: Template children stay out of the rendered document until their fragment is inserted.
HTML✓ Tested
Collect borrowed values into owned strings
Collect borrowed values into owned strings in a complete Rust program using the standard library.
Rust✓ Tested
Collect ordered values into an array
Build a sorted array from query rows.
array_agg✓ Tested
Combine a branch’s changes into one new commit
Git: Squash prepares the combined changes in the index without recording a merge parent.
Git✓ Tested
Combine a stable entrypoint with default arguments
Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.
Docker / Compose✓ Tested
Combine several Serial.print calls
Arduino / C: Combine several Serial.print calls on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
TypeScript: Use an absolute error threshold for values known to be near one.
TypeScript✓ Tested
Compare floating-point calculations with tolerance
Python: Use isclose instead of exact equality for results affected by floating-point rounding.
Python✓ Tested
Compare floating-point results with a tolerance
Java: For this bounded example, compare the absolute difference against a chosen error threshold.
Java✓ Tested
Compare small floating-point results with a tolerance
C: Use an absolute difference threshold for this known bounded magnitude.
C✓ Tested
Compute an integer weighted average
SQL: Multiply before summing and guard a zero total weight with NULLIF.
SQL✓ Tested