calculate_eps
Calculate earnings per share (EPS): net income divided by weighted average shares outstanding — profit attributable to each share. Formula: EPS = Net Income / Weighted Average Shares Outstanding. WHEN TO USE: Use as the denominator for P/E and payout ratios and to track per-share profitability over time. WHEN NOT TO USE: Do NOT use basic share count when convertible securities exist — use diluted shares for a conservative EPS. BEHAVIOUR: pure deterministic calculation — no side effects, no network or storage access; idempotent and non-destructive; identical inputs always produce identical outputs. Division by zero or non-finite inputs returns an explicit error instead of a number. RETURNS: JSON object { eps: number (currency per share, e.g. 1.25), inputs }. PARAMETERS: net_income (required): Net income attributable to common shareholders, e.g. 1250000. May be negative. weighted_avg_shares_outstanding (required): Weighted average shares outstanding during the period, e.g. 1000000. Must be > 0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| net_income | Yes | Net income attributable to common shareholders, e.g. 1250000. May be negative. | |
| weighted_avg_shares_outstanding | Yes | Weighted average shares outstanding during the period, e.g. 1000000. Must be > 0. |