Results for “Numeric parsing & arithmetic”
Small, practical examples. Search by task or narrow things down below.
Print text containing percent characters literally
Bash Scripts: Never use untrusted text as the printf format string.
Bash Scripts✓ Tested
Read fields captured by a Bash regular expression
Bash Scripts: BASH_REMATCH contains the full match followed by capture groups after a successful regex test.
Bash Scripts✓ Tested
Remove a trailing carriage return from a line
Bash Scripts: Use an ANSI-C quoted carriage return as the suffix pattern.
Bash Scripts✓ Tested
Round halfway floating-point values away from zero
C++: std::round has an explicit halfway rule different from truncation.
C++✓ Tested
Set and clear a bit in a shell integer
Bash Scripts: Use shifts and bitwise operators for a small flag field.
Bash Scripts✓ Tested
Split a record while retaining its remainder
Bash Scripts: The final read variable receives the remainder of a delimited record.
Bash Scripts✓ Tested
Add context to a parsing failure
Add context to a parsing failure in a complete Rust program using the standard library.
Rust✓ Tested
Animate a numeric CSS property
jQuery: animate interpolates supported numeric properties to their final values.
jQuery✓ Tested
Bind a numeric input value
Bind a numeric input value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Bind a numeric style with units
Bind a numeric style with units with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Calculate each group’s numeric spread
SQL: Subtract MIN from MAX to report the difference between extremes.
SQL✓ Tested
Calculate each group’s numeric spread
SQL Server: Subtract MIN from MAX to report the difference between extremes.
SQL Server✓ Tested