FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
C++Sequence algorithms

Calculate the dot product of two vectors

C++: inner_product multiplies corresponding elements and accumulates them from a chosen seed.

C++✓ Tested
CSmall algorithms & bit operations

Calculate the greatest common divisor

C: Euclid’s algorithm repeatedly replaces a pair with the divisor and remainder.

C✓ 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
SQLiteDates & time

Calculate whole days between dates

Subtract Julian day values for date-only inputs.

julianday✓ Tested
PythonNumbers & calculations

Calculate with exact rational values

Python: Use Fraction for exact ratios rather than binary floating-point approximations.

Python✓ Tested
Arduino / CGetting Started

Calculate with integer values

Arduino / C: Calculate with integer values on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
GoGetting Started

Call a function with a return value

Call a function with a return value using a complete Go program with explicit sample inputs.

Go✓ Tested
PythonGetting Started

Call a library function

Python: Use a standard absolute-value function with a small negative number.

Python✓ Tested
JavaGetting Started

Call a library function

Java: Use a standard absolute-value function with a small negative number.

Java✓ Tested
TypeScriptGetting Started

Call a library function

TypeScript: Use a standard absolute-value function with a small negative number.

TypeScript✓ Tested
C++Getting Started

Call a library function

C++: Use a standard absolute-value function with a small negative number.

C++✓ Tested
CGetting Started

Call a library function

C: Use a standard absolute-value function with a small negative number.

C✓ Tested