Results for “number”
Small, practical examples. Search by task or narrow things down below.
Span a group header across several rows
HTML: Rowspan can label a group of related rows without repeating the label.
HTML✓ Tested
Span one header across several columns
HTML: Colspan lets a heading cover a defined number of columns in the table grid.
HTML✓ Tested
Subtract durations without underflow
Subtract durations without underflow in a complete Rust program using the standard library.
Rust✓ Tested
Type a function’s inputs and output
Catch mismatched arguments during compilation.
function✓ Tested
Use a nonnegative remainder for cyclic indexing
Use a nonnegative remainder for cyclic indexing in a complete Rust program using the standard library.
Rust✓ Tested
Validate a complete numeric serial command
Arduino / C: Check for digits, an end pointer, and an application-specific range.
Arduino / C✓ Tested
Validate a finite numeric value without coercion
JavaScript: Number.isFinite rejects numeric strings as well as NaN and infinity.
JavaScript✓ Tested
Validate a finite numeric value without coercion
TypeScript: Number.isFinite rejects numeric strings as well as NaN and infinity.
TypeScript✓ Tested
Add days to a date
Parse an ISO date and add calendar days using Java LocalDate.
Java✓ Tested
Allocate a zeroed array
Check calloc, use the allocation, and release it in C.
C✓ Tested
Calculate an average without integer division truncation
C: Accumulate into double and divide by the nonzero number of readings.
C✓ Tested
Call a library function
Python: Use a standard absolute-value function with a small negative number.
Python✓ Tested