@basic-math/add
v0.1.0
Published
Type-safe addition operation with SafeNumber validation
Maintainers
Readme
@basic-math/add
Type-safe addition operation with SafeNumber validation.
Installation
npm install @basic-math/add @basic-math/coreUsage
import { add } from '@basic-math/add';
const result = add(5, 3); // 8
const decimal = add(1.5, 2.3); // 3.8
const negative = add(-5, 3); // -2Features
- Type-safe addition using SafeNumber
- Runtime validation
- Handles positive, negative, and decimal numbers
- Zero dependencies (except @basic-math/core)
API
add(a: number, b: number): number
Adds two numbers together with validation.
Parameters:
a- First numberb- Second number
Returns: Sum of a and b
Throws: TypeViolationError or NumericInvariantError if inputs are invalid
License
MIT
