UNPKG

mcp-subagents

Version:

Multi-Agent AI Orchestration via Model Context Protocol - Access specialized CLI AI agents (Aider, Qwen, Gemini, Goose, etc.) with intelligent fallback and configuration

75 lines 2.5 kB
export declare function add(a: number, b: number): number; /** * This module provides utility functions for mathematical operations. * * ## Functionality * The `sumOfSquaredPositives` function demonstrates: * - **Filtering**: Removes negative numbers from an array. * - **Squaring**: Squares each remaining positive number. * - **Summing**: Sums the squared numbers to return a single result. * * ## Detailed Examples * The following examples demonstrate the function's behavior with various inputs: * * ### Examples * 1. **Example 1** * - **Input**: `[1, -2, 3, -4, 5]` * - **Process**: * - **Filter**: `[1, 3, 5]` (removes `-2`, `-4`) * - **Square**: `[1², 3², 5²]` (squares each number) * - **Sum**: `35` (1 + 9 + 25) * - **Output**: `35` * * 2. **Example 2** * - **Input**: `[-1, -2, -3]` * - **Process**: * - **Filter**: `[]` (all numbers are negative) * - **Square**: `[]` (no numbers to square) * - **Sum**: `0` (sum of an empty array) * - **Output**: `0` * * 3. **Example 3** * - **Input**: `[0, 1, 2, 3]` * - **Process**: * - **Filter**: `[0, 1, 2, 3]` (no negative numbers) * - **Square**: `[0², 1², 2², 3²]` (squares each number) * - **Sum**: `14` (0 + 1 + 4 + 9) * - **Output**: `14` * * 4. **Example 4** * - **Input**: `[]` * - **Process**: * - **Filter**: `[]` (empty input) * - **Square**: `[]` (no numbers to square) * - **Sum**: `0` (sum of an empty array) * - **Output**: `0` * * 5. **Example 5** * - **Input**: `[4, 5, -6, 7]` * - **Process**: * - **Filter**: `[4, 5, 7]` (removes `-6`) * - **Square**: `[4², 5², 7²]` (squares each number) * - **Sum**: `90` (16 + 25 + 49) * - **Output**: `90` * * 6. **Example 6** * - **Input**: `[-10, 10, -10]` * - **Process**: * - **Filter**: `[10]` (removes `-10`, `-10`) * - **Square**: `[10²]` (squares the number) * - **Sum**: `100` (100) * - **Output**: `100` */ /** * Takes an array of numbers, filters out negative numbers, * squares each remaining positive number, and returns the sum. * * @param numberArray - Array of numbers to process * @returns Sum of squares of non-negative numbers * * @example * // returns 35 [1² + 3² + 5² = 1 + 9 + 25] * sumOfSquaredPositives([1, -2, 3, -4, 5]); */ export declare function sumOfSquaredPositives(numberArray: number[]): number; //# sourceMappingURL=math.d.ts.map