Results for “Reporting & grouped calculations”
Small, practical examples. Search by task or narrow things down below.
Reject nonfinite floating-point values
Java: Double.isFinite excludes both infinity and NaN.
Java✓ Tested
Reject one outlier with a median-of-three filter
Arduino / C: Sorting three values leaves the median in the middle.
Arduino / C✓ Tested
Represent a decimal quantity with a scaled integer
Arduino / C: Integer hundredths avoid floating-point storage for fixed-precision values.
Arduino / C✓ Tested
Round a decimal with an explicit rule
Java: Construct BigDecimal from text to avoid importing a binary floating-point approximation.
Java✓ Tested
Round decimal amounts explicitly
Python: Build Decimal values from strings and choose a rounding rule explicitly.
Python✓ Tested
Round halfway floating-point values away from zero
C++: std::round has an explicit halfway rule different from truncation.
C++✓ Tested
Select the largest values without sorting everything
Python: Use heapq.nlargest when only a small prefix of the ranking is required.
Python✓ Tested
Smooth a sequence with an exponential filter
Arduino / C: Blend each sample with the previous filtered value.
Arduino / C✓ Tested
Filter aggregate groups
Keep only categories with multiple products.
HAVING✓ Tested
Reject NaN and infinite values
PowerShell: Double.IsFinite excludes numeric values unsuitable for ordinary bounded calculations.
PowerShell✓ Tested
Remove duplicate values while keeping the smallest key
SQL: Identify retained keys in a grouped subquery before deleting other copies.
SQL✓ Tested
Remove duplicate values while keeping the smallest key
SQL Server: Identify retained keys in a grouped subquery before deleting other copies.
SQL Server✓ Tested