Read n_periods_per_year the same strict way in every operation

A string, zero, a negative or a non-number is now refused instead of
falling back to the default, and portfolioVariance and monteCarlo also
refuse a fraction rather than truncate it. covarianceFromReturns still
takes a fractional factor, since it scales by it as a double.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 files changed