Your build starts here
Replace bracketed details with your own goal, context, and checks. Keep the first build small enough to inspect.
Implement [nonfinancial quantity calculation] from decimal strings and explicit units. Define supported units, valid ranges, target precision, rounding rule, and whether rounding occurs at each step or only at a named output boundary. Use the project's suitable decimal or exact representation where the requirement calls for it, and avoid introducing binary floating-point values before that representation is constructed. Build fixtures for ordinary values, halfway rounding cases, a repeating division, unit conversion, a negative value where allowed, and invalid or non-finite input. Verify a hand-calculated reference and dimensional invariants such as converting to a unit and back within the agreed rule. Preserve original inputs alongside derived values for diagnosis. On invalid data, return an explicit result rather than silently replacing it with zero. Report representation limits and how display formatting differs from stored meaning.Make this prompt yours
Use for measurement and quantity workflows with an explicit precision requirement. Decimal arithmetic still needs a defined context and rounding policy.
You might also hear
- decimal strings
- quantize
- rounding boundary
- measurement units
- numerical invariant
The docs behind it
These references explain the underlying concepts and APIs. The prompt templates and project plans are original examples to adapt to your own setup.
Research sources reviewed .
Editorial review · October 28, 2026
Limited: Original instructional template; not executed. Decimal-string construction avoids first rounding through binary floats; decimal arithmetic still requires precision/rounding context and unit/domain rules.