FIND YOUR NEXT FEW LINES

Results for “Numeric parsing & arithmetic”

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

213 snippets foundClear filters
CGetting Started

Calculate a simple total

C: Multiply a unit price by a quantity, then add a delivery fee.

C✓ Tested
GoGetting Started

Calculate a subtotal

Calculate a subtotal using a complete Go program with explicit sample inputs.

Go✓ Tested
SQLGetting Started

Calculate a value with SELECT

SQL: Evaluate a small arithmetic expression on the database server.

SQL✓ Tested
SQL ServerGetting Started

Calculate a value with SELECT

SQL Server: Evaluate a small arithmetic expression on the database server.

SQL Server✓ Tested
PostgresGetting Started

Calculate a value with SELECT

Postgres: Evaluate a small arithmetic expression on the database server.

Postgres✓ Tested
SQLiteGetting Started

Calculate a value with SELECT

SQLite: Evaluate a small arithmetic expression on the database server.

SQLite✓ Tested
RustGetting Started

Calculate an order subtotal

Calculate an order subtotal in a complete Rust program using the standard library.

Rust✓ Tested
JavaPrecise numeric calculations

Calculate beyond the long integer range

Java: Use BigInteger when a fixed-width primitive type would overflow.

Java✓ Tested
JavaScriptNumbers & numeric validation

Calculate integers beyond Number’s precise range

JavaScript: Use BigInt operands together to avoid precision loss.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Calculate integers beyond Number’s precise range

TypeScript: Use BigInt operands together to avoid precision loss.

TypeScript✓ Tested
C++Text validation & parsing

Check a literal prefix in C++17

C++: Use string compare because starts_with was introduced after C++17.

C++✓ Tested
C++Text validation & parsing

Check a literal suffix in C++17

C++: Check lengths before subtracting to avoid an unsigned underflow.

C++✓ Tested