Repository inventory

code-and-sorts/awesome-copilot-agents

Skills indexed from this repository, with install-style signals scoped to the repo.
2 skills692 GitHub stars0 weekly installsTypeScriptGitHubOwner profile

Overview

This skill performs arbitrary-precision arithmetic using a decimal math library to avoid floating-point errors. It handles addition, subtraction, multiplication, division, integer exponents, and parenthetical expressions with correct operator precedence. Use it when exact decimal results matter or when evaluating user-supplied arithmetic expressions.

How this skill works

The skill parses a textual arithmetic expression, respecting parentheses and operator precedence, then evaluates it using arbitrary-precision decimal arithmetic (big.js). Exponentiation is right-associative and requires integer exponents. Errors are raised for empty input, mismatched parentheses, division by zero, or non-integer exponents.

When to use it

  • When a user asks to calculate, compute, or evaluate a math expression
  • When precise decimal results are needed (avoid 0.1 + 0.2 floating-point noise)
  • When expressions include parentheses and operator precedence
  • When working with integer exponents and high-precision decimal arithmetic
  • For simple numeric evaluation without variables or symbolic math

Best practices

  • Provide a single well-formed expression string without variables
  • Use parentheses to make precedence explicit and avoid ambiguity
  • Keep exponents as integers to ensure correct evaluation
  • Validate input length and characters before evaluation to prevent injection
  • Handle and surface errors: empty input, mismatched parentheses, division by zero

Example use cases

  • Evaluate money calculations where exact decimal cents matter (e.g., 19.95 * 3 / 7)
  • Compute nested expressions with parentheses like (2 + 3) * 4 or 1 + 4.5 * (3 - 6) / 5
  • Calculate large integer powers such as 2 ^ 10 or right-associative chains like 2 ^ 3 ^ 2
  • Avoid JavaScript floating-point surprises such as 0.1 + 0.2
  • Run quick arithmetic checks inside scripts or tools that require precise decimal output

FAQ

No. It only supports basic arithmetic, parentheses, and integer exponents.

What happens with non-integer exponents?

Non-integer exponents are not supported; the underlying decimal pow requires integer exponents and will error.

2 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational