Results for “Numeric parsing & calculations”
Small, practical examples. Search by task or narrow things down below.
Set and clear a bit in a shell integer
Bash Scripts: Use shifts and bitwise operators for a small flag field.
Bash Scripts✓ Tested
Smooth a sequence with an exponential filter
Arduino / C: Blend each sample with the previous filtered value.
Arduino / C✓ Tested
Split a record while retaining its remainder
Bash Scripts: The final read variable receives the remainder of a delimited record.
Bash Scripts✓ Tested
Trim surrounding ASCII whitespace
C++: Find the first and last non-whitespace bytes before taking a substring.
C++✓ Tested
Turn known group values into columns
SQL: Conditional aggregation gives a portable pivot when the category set is known.
SQL✓ Tested
Turn known group values into columns
SQL Server: Conditional aggregation gives a portable pivot when the category set is known.
SQL Server✓ Tested
Turn known group values into columns
Postgres: Conditional aggregation gives a portable pivot when the category set is known.
Postgres✓ Tested
Turn known group values into columns
SQLite: Conditional aggregation gives a portable pivot when the category set is known.
SQLite✓ Tested
Validate a complete identifier
C++: regex_match requires the pattern to match the complete input sequence.
C++✓ Tested
Validate a simple C-style ASCII identifier
C: Check the first character separately from subsequent characters and reject empty input.
C✓ Tested
Animate relative to the current value
jQuery: A plus-equals value adds to the current numeric CSS value.
jQuery✓ Tested
Check whether input is a nonnegative integer
Reject empty input and nonnumeric characters before arithmetic.
validation✓ Tested