FIND YOUR NEXT FEW LINES

Results for “positive”

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

20 snippets foundClear filters
CNumeric parsing & arithmetic

Check positive integer addition before performing it

C: Check the upper boundary before adding two known nonnegative integers.

C✓ Tested
SQLConstraints & defaults

Reject a negative quantity with CHECK

SQL: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

SQL✓ Tested
SQL ServerConstraints & defaults

Reject a negative quantity with CHECK

SQL Server: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

SQL Server✓ Tested
PostgresConstraints & defaults

Reject a negative quantity with CHECK

Postgres: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

Postgres✓ Tested
SQLiteConstraints & defaults

Reject a negative quantity with CHECK

SQLite: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.

SQLite✓ Tested
JavaScriptNumbers & numeric validation

Calculate a page count with ceiling division

JavaScript: Use Math.ceil for a nonnegative item count and a positive page size.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Calculate a page count with ceiling division

TypeScript: Use Math.ceil for a nonnegative item count and a positive page size.

TypeScript✓ Tested
PythonNumbers & calculations

Calculate the number of required pages

Python: Use integer arithmetic to round a nonnegative count up to a positive page size.

Python✓ Tested
SQLiteQueries & text

Extract part of a string

Use one-based positions with substr.

substr✓ Tested
C++Numeric parsing & calculations

Find the least common multiple with the standard library

C++: std::lcm combines positive integer periods into a common cycle.

C++✓ Tested
PythonGetting Started

Repeat while a condition holds

Python: Count down while a positive number remains, updating the loop variable on each iteration.

Python✓ Tested
C#Getting Started

Repeat while a condition holds

C#: Count down while a positive number remains, updating the loop variable on each iteration.

C#✓ Tested