Commit 764ebe8
committed
Fix SymPy OverflowError in solow.md by using Rational
The SymPy solve() function was failing with 'mpz too large to convert
to float' when using Python float values (0.3, 0.5, 2.0) in symbolic
expressions with fractional exponents.
Using sympy.Rational for exact arithmetic avoids the large intermediate
mpz values that caused the overflow in factorint().1 parent c79d1da commit 764ebe8
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
517 | 522 | | |
518 | | - | |
519 | | - | |
| 523 | + | |
| 524 | + | |
520 | 525 | | |
521 | 526 | | |
522 | 527 | | |
523 | 528 | | |
524 | 529 | | |
525 | 530 | | |
526 | 531 | | |
527 | | - | |
| 532 | + | |
528 | 533 | | |
529 | 534 | | |
530 | 535 | | |
| |||
0 commit comments