FIND YOUR NEXT FEW LINES

Results for “Numbers & numeric validation”

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

266 snippets foundClear filters
CNumbers & memory

Allocate a zeroed array

Check calloc, use the allocation, and release it in C.

C✓ Tested
jQueryAnimation completion

Animate relative to the current value

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

jQuery✓ Tested
CArrays

Count matching values

Count even numbers in a fixed C array.

C✓ Tested
PostgresDates & series

Extract part of a date

Read a calendar component with EXTRACT.

EXTRACT✓ Tested
PowerShellCollections & objects

Filter items in a pipeline

Keep numbers that meet a condition.

Where-Object✓ Tested
C++Numbers & algorithms

Find the largest value

Check for an empty C++ vector before dereferencing max_element.

C++✓ 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
JavaNumbers & dates

Format a decimal number

Format a Java decimal with two digits and a fixed locale.

Java✓ Tested
CNumbers & memory

Format a decimal value

Print two fractional digits with C printf.

C✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
C++Numbers & algorithms

Format decimal output

Use fixed and setprecision to print two C++ decimal places.

C++✓ Tested
Linux CommandsDates & process utilities

Generate a stepped sequence

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

Linux Commands✓ Tested