Results for “int”
Small, practical examples. Search by task or narrow things down below.
Reject an integer with trailing characters
Arduino / C: strtol exposes an end pointer so a parser can require the entire token.
Arduino / C✓ Tested
Reject nonfinite floating-point values
Java: Double.isFinite excludes both infinity and NaN.
Java✓ Tested
Represent a decimal quantity with a scaled integer
Arduino / C: Integer hundredths avoid floating-point storage for fixed-precision values.
Arduino / C✓ Tested
Resolve a merge by writing the intended final file
Git: After a conflict, edit the result, stage it, and finish the merge commit.
Git✓ Tested
Round a decimal using an explicit midpoint rule
C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.
C#✓ Tested
Round a decimal with a chosen midpoint rule
PowerShell: Use decimal input and an explicit rounding policy for a reproducible decimal result.
PowerShell✓ Tested
Round a halfway floating-point value
C: The C round function rounds halfway cases away from zero.
C✓ Tested
Round halfway floating-point values away from zero
C++: std::round has an explicit halfway rule different from truncation.
C++✓ Tested
Scroll a referenced element into view
Scroll a referenced element into view with a small React component and explicit browser behavior.
React✓ Tested
Send command output into another command
Linux Commands: Send command output into another command using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Send text into a container through stdin
Docker / Compose: Send text into a container through stdin using a locally available Ubuntu image.
Docker / Compose✓ Tested
Separate prose into paragraphs
HTML: Learn how to separate prose into paragraphs in a complete browser example.
HTML✓ Tested