Repository navigation
Commit 69fce25
authored
Fix float when min and max are too far apart (#225)
Rearrange the arithmetic expression such that intermediate operations
are always within the bounds of floating-point numbers that can be
represented by the system.
- Fixes ArithmeticError exception when max - min >= 1.79e308.
- Fixes floats generated outside of [min, max] range when upper/lower
limits were lost due to loss of significance.1 parent 5d45b3a commit 69fce25
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1753 | 1753 | | |
1754 | 1754 | | |
1755 | 1755 | | |
1756 | | - | |
| 1756 | + | |
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
297 | 311 | | |
298 | 312 | | |
299 | 313 | | |
| |||
0 commit comments