FIND YOUR NEXT FEW LINES

Results for “or”

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

2638 snippets foundClear filters
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
C++Sequence algorithms

Calculate changes between successive readings

C++: adjacent_difference keeps the first value and then writes each difference from its predecessor.

C++✓ Tested
C++Sequence algorithms

Calculate cumulative totals

C++: partial_sum writes the sum of each input prefix to the output sequence.

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
SQLReporting & grouped calculations

Calculate each group’s numeric spread

SQL: Subtract MIN from MAX to report the difference between extremes.

SQL✓ Tested
SQL ServerReporting & grouped calculations

Calculate each group’s numeric spread

SQL Server: Subtract MIN from MAX to report the difference between extremes.

SQL Server✓ Tested
PostgresReporting & grouped calculations

Calculate each group’s numeric spread

Postgres: Subtract MIN from MAX to report the difference between extremes.

Postgres✓ Tested
SQLiteReporting & grouped calculations

Calculate each group’s numeric spread

SQLite: Subtract MIN from MAX to report the difference between extremes.

SQLite✓ Tested
JavaStream transformations

Calculate several numeric stream statistics

Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.

Java✓ Tested