FIND YOUR NEXT FEW LINES

Results for “Precise numeric calculations”

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

198 snippets foundClear filters
SQLiteReporting & grouped calculations

Turn known group values into columns

SQLite: Conditional aggregation gives a portable pivot when the category set is known.

SQLite✓ Tested
CNumeric parsing & arithmetic

Validate a complete floating-point input

C: strtod exposes both the stopping position and range errors; reject nonfinite results when required.

C✓ Tested
jQueryAnimation completion

Animate relative to the current value

jQuery: A plus-equals value adds to the current numeric CSS value.

jQuery✓ Tested
Bash ScriptsLoops & decisions

Check whether input is a nonnegative integer

Reject empty input and nonnumeric characters before arithmetic.

validation✓ Tested
C++Numbers & algorithms

Clamp a value to a range

Use C++17 clamp to bound a numeric value.

C++✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
PostgresDates & series

Extract part of a date

Read a calendar component with EXTRACT.

EXTRACT✓ Tested
CArray transformations

Find the smallest value in a nonempty array

C: Initialize from the first element instead of assuming a numeric sentinel.

C✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
Linux CommandsDates & process utilities

Generate a stepped sequence

Linux Commands: Use seq when a command pipeline needs a numeric sequence.

Linux Commands✓ Tested
TypeScriptTypes & functions

Narrow a union using typeof

Handle text and numeric values with separate branches.

union✓ Tested
PowerShellStrings & literal text

Pad a label with leading zeroes

PowerShell: Use a numeric format specifier to control the displayed width.

PowerShell✓ Tested