Results for “ERROR_NUMBER”
Small, practical examples. Search by task or narrow things down below.
Catch a T-SQL error
Handle an expected conversion error in TRY/CATCH.
TRY CATCH✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
TypeScript: Use an absolute error threshold for values known to be near one.
TypeScript✓ Tested
Accept a variable number of arguments
Accept a variable number of arguments using a complete Go program with explicit sample inputs.
Go✓ Tested
Advance a date by a number of days
Python: Use timedelta so month and year boundaries are handled automatically.
Python✓ Tested
Calculate integers beyond Number’s precise range
JavaScript: Use BigInt operands together to avoid precision loss.
JavaScript✓ Tested
Calculate integers beyond Number’s precise range
TypeScript: Use BigInt operands together to avoid precision loss.
TypeScript✓ Tested
Calculate the number of calendar days between dates
C#: Subtract DayNumber values when the inputs are calendar dates.
C#✓ Tested
Calculate the number of required pages
Python: Use integer arithmetic to round a nonnegative count up to a positive page size.
Python✓ Tested
Capture standard output and standard error separately
Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.
Bash Scripts✓ Tested
Clamp a number between inclusive bounds
JavaScript: Combine Math.min and Math.max when lower is no greater than upper.
JavaScript✓ Tested
Clamp a number between inclusive bounds
TypeScript: Combine Math.min and Math.max when lower is no greater than upper.
TypeScript✓ Tested