Results for “as”
Small, practical examples. Search by task or narrow things down below.
Compute a two-dimensional vector length
C: hypot avoids unnecessary intermediate overflow compared with squaring both inputs directly.
C✓ Tested
Compute an integer weighted average
SQL: Multiply before summing and guard a zero total weight with NULLIF.
SQL✓ Tested
Compute an integer weighted average
SQL Server: Multiply before summing and guard a zero total weight with NULLIF.
SQL Server✓ Tested
Compute an integer weighted average
Postgres: Multiply before summing and guard a zero total weight with NULLIF.
Postgres✓ Tested
Compute an integer weighted average
SQLite: Multiply before summing and guard a zero total weight with NULLIF.
SQLite✓ Tested
Compute beyond the fixed-width integer range
PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.
PowerShell✓ Tested
Concatenate arrays without mutating either input
TypeScript: concat creates a shallow combined sequence.
TypeScript✓ Tested
Constrain a calendar date input
HTML: Use ISO date values for the date control’s minimum and maximum.
HTML✓ Tested
Constrain and center a container
Use max-width and auto margins for a centered CSS reading area.
CSS✓ Tested
Construct a date from Unix seconds
TypeScript: Multiply seconds by 1000 before creating a Date.
TypeScript✓ Tested
Construct a named-field struct
Construct a named-field struct in a complete Rust program using the standard library.
Rust✓ Tested
Construct a struct with default values
Construct a struct with default values in a complete Rust program using the standard library.
Rust✓ Tested