FIND YOUR NEXT FEW LINES

Results for “zero”

Small, practical examples. Search by task or narrow things down below.

90 snippets foundClear filters
Arduino / CBinary values & packets

Assign a bit from a Boolean state

Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Calculate a CRC-8 over a byte sequence

Arduino / C: This implementation uses polynomial 0x07, initial zero, and no reflection.

Arduino / C✓ Tested
CNumeric parsing & arithmetic

Calculate a page count without an overflowing addition

C: Divide first and add one only when a nonzero remainder remains.

C✓ Tested
CSmall algorithms & bit operations

Calculate an average without integer division truncation

C: Accumulate into double and divide by the nonzero number of readings.

C✓ Tested
SQLReporting & grouped calculations

Calculate each group’s integer percentage of the total

SQL: Multiply before division and protect against a zero denominator.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Calculate each group’s integer percentage of the total

SQL Server: Multiply before division and protect against a zero denominator.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Calculate each group’s integer percentage of the total

Postgres: Multiply before division and protect against a zero denominator.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Calculate each group’s integer percentage of the total

SQLite: Multiply before division and protect against a zero denominator.

SQLite✓ Tested
CSSPositioning & stacking

Center a fixed-size absolute child with auto margins

CSS: An all-zero inset plus auto margins distributes the available space around the child.

CSS✓ Tested
JavaScriptArray traversal & selection

Check array membership with includes

JavaScript: includes uses SameValueZero comparison, which also matches NaN.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check array membership with includes

TypeScript: includes uses SameValueZero comparison, which also matches NaN.

TypeScript✓ Tested
Bash ScriptsFiles & reliability

Check that a file is present and nonempty

Test file content availability before reading it.

file check✓ Tested