Results for “Numeric parsing & calculations”
Small, practical examples. Search by task or narrow things down below.
Group by more than one field
SQL Server: Each distinct combination of grouping fields produces its own row.
SQL Server✓ Tested
Group by more than one field
Postgres: Each distinct combination of grouping fields produces its own row.
Postgres✓ Tested
Group by more than one field
SQLite: Each distinct combination of grouping fields produces its own row.
SQLite✓ Tested
Ignore small movements around a center value
Arduino / C: Values inside the deadband become zero while others keep their direction.
Arduino / C✓ Tested
Increment a counter without an unexpected errexit
Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.
Bash Scripts✓ Tested
Insert a value while preserving sorted order
Python: Use insort on an already sorted list; insertion still shifts later list elements.
Python✓ Tested
Inspect a substring without allocating a copy
C++: A string_view refers to existing storage and must not outlive that storage.
C++✓ Tested
Interpolate between two calibration points
Arduino / C: Compute a fractional position before scaling to the output interval.
Arduino / C✓ Tested
Iterate over all regular-expression matches
C++: A regex iterator yields successive matches without manually updating an offset.
C++✓ Tested
Maintain a rolling sum in a circular window
Arduino / C: Subtract the overwritten sample before adding the next one.
Arduino / C✓ Tested
Parse a Boolean literal
Parse a Boolean literal in a complete Rust program using the standard library.
Rust✓ Tested
Parse a bounded simple record with sscanf
C: A width limit protects the destination buffer and the consumed count detects trailing junk.
C✓ Tested