Results for “Numeric parsing & arithmetic”
Small, practical examples. Search by task or narrow things down below.
Calculate each group’s numeric spread
Postgres: Subtract MIN from MAX to report the difference between extremes.
Postgres✓ Tested
Calculate each group’s numeric spread
SQLite: Subtract MIN from MAX to report the difference between extremes.
SQLite✓ Tested
Calculate several numeric stream statistics
Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.
Java✓ Tested
Calculate with integer arithmetic
Bash Scripts: Calculate with integer arithmetic with a small standalone Bash program.
Bash Scripts✓ Tested
Choose among several numeric ranges
Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.
Bash Scripts✓ Tested
Choose floating-point arithmetic
Choose floating-point arithmetic in a complete Rust program using the standard library.
Rust✓ Tested
Clamp a numeric value between bounds
Python: Combine min and max for a closed interval when lower is no greater than upper.
Python✓ Tested
Convert known numeric text to an integer
Python: Convert a trusted literal to an integer before adding. Validate external input before converting it.
Python✓ Tested
Convert known numeric text to an integer
C#: Convert a trusted literal to an integer before adding. Validate external input before converting it.
C#✓ Tested
Convert known numeric text to an integer
Java: Convert a trusted literal to an integer before adding. Validate external input before converting it.
Java✓ Tested
Convert known numeric text to an integer
JavaScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.
JavaScript✓ Tested
Convert known numeric text to an integer
TypeScript: Convert a trusted literal to an integer before adding. Validate external input before converting it.
TypeScript✓ Tested