Results for “zero”
Small, practical examples. Search by task or narrow things down below.
Allocate a zeroed array
Check calloc, use the allocation, and release it in C.
C✓ Tested
Compare binary buffers including zero bytes
C: memcmp checks an explicit byte length rather than stopping at a string terminator.
C✓ Tested
Distinguish missing keys from zero values
Distinguish missing keys from zero values using a complete Go program with explicit sample inputs.
Go✓ Tested
Drop the fractional part toward zero
JavaScript: Math.trunc differs from floor for negative inputs.
JavaScript✓ Tested
Drop the fractional part toward zero
TypeScript: Math.trunc differs from floor for negative inputs.
TypeScript✓ Tested
Format a numeric label with leading zeroes
Bash Scripts: Use a constant printf format string and supply values as separate arguments.
Bash Scripts✓ Tested
Format a zero-padded numeric label
Linux Commands: Use printf formatting instead of concatenating a variable number of zeroes.
Linux Commands✓ Tested
Handle a nonzero background-job exit
Bash Scripts: Wait reports a child’s exit code; put it in a conditional when failure is expected.
Bash Scripts✓ Tested
Include zero counts for missing relationships
SQL: Count the non-null child key after a left join so a missing relationship produces zero.
SQL✓ Tested
Include zero counts for missing relationships
SQL Server: Count the non-null child key after a left join so a missing relationship produces zero.
SQL Server✓ Tested
Include zero counts for missing relationships
Postgres: Count the non-null child key after a left join so a missing relationship produces zero.
Postgres✓ Tested
Include zero counts for missing relationships
SQLite: Count the non-null child key after a left join so a missing relationship produces zero.
SQLite✓ Tested