francy51 fe1fed97c5 Populate null earnings fields with safe margin calculations
Add calculated values for gross_profit_margin, operating_margin, and
other_operating_expenses to provide more comprehensive financial data
matching fiscal.ai methodology.

Implementation:
- Add calculate_gross_profit_margin() function for (Gross Profit / Revenue) × 100
- Add calculate_operating_margin() function for (Operating Profit / Revenue) × 100
- Add calculate_other_operating_expenses() to derive from components
- Include comprehensive unit tests with edge case coverage

Safety features:
- Null propagation using ? operator for missing data
- Division protection with f64::EPSILON checks
- Proper handling of negative values (losses)
- Semantic distinction between Some(0.0) and None

Validation: MSFT FY2024 data shows 68.8% gross margin and 45.6%
operating margin, matching fiscal.ai calculations.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 16:34:38 -04:00
2026-04-04 12:17:18 -04:00
Description
No description provided
4.3 MiB
Languages
Rust 58%
TypeScript 41.4%
CSS 0.5%