mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-30 10:13:56 +01:00
When a source number is larger than 2^600, least_squares multiplies the numbers by 2^-600 before the fit and multiplies the fitted values and the step by 2^600 afterward. A source of 1e308 four times and then 0 now continues at 2e307; before, the covariance sum overflowed and the target cell showed #NUM!. The test for numbers near the largest double compares to within 1e-9 instead of exactly, since the rounding to 15 digits of 1e308 gives 1.0000000000000004e308 on Linux.