Fix #293: Allow restarts for FP overflow in reader
- Apr 11, 2024
-
-
Raymond Toy authored
-
- Apr 10, 2024
-
-
Raymond Toy authored
-
Raymond Toy authored
We were just signaling a reader-error, but now we need to signal a FP overflow so that we can do a restart. Update cmucl.pot for the new strings.
-
Raymond Toy authored
-
Raymond Toy authored
Previously, when the numbers were very tiny, we signaled a reader-error but didn't have a restart to return 0. Modify the code so that when we have very tiny numbers, we signal a `floating-point-underflow` error that we can catch and establish a restart to return 0. For very large numbers that overflow, we just signal a reader-error for now. Update cmucl.pot too for the new string.
-
Raymond Toy authored
-
Raymond Toy authored
In the test, we had underflow enabled, but computed numbers that would underflow. Hence, only wrap the part that reads floats with underflow enabled.
-
Raymond Toy authored
We should be able to read denormals without problems even if FP underflow is enabled.
-
Raymond Toy authored
-
Raymond Toy authored
Update cmucl.pot for the changed strings too.
-
- Apr 07, 2024
-
-
Raymond Toy authored
-
Raymond Toy authored
We changed the message string for FP underflows in the reader so we need to update the test with this new string.
-
Raymond Toy authored
-
Raymond Toy authored
Update the pot file due to the change in the message string.
-
Raymond Toy authored
Update the pot file due to the change in the message string.
-
- Mar 29, 2024
-
-
Raymond Toy authored
-
Raymond Toy authored
-
Raymond Toy authored
Verify that the two new restarts produce the correct values when selecting the "infinity" and "largest-float" restarts.
-
Raymond Toy authored
When a FP overflow occurs when reading a float, allow the user to restart the computation by returning a floating-point infinity or by returning the largest float. The function `restart-overflow` performs the restart and returns the desired value if so selected. `make-float-aux` calls `restart-overflow` when the number is known to be too large or when a floating-point-overflow is signaled from `coerce`. However to make that work, `check-exponent` in `bignum-to-float-float` must signal a `floating-point-overflow` instead of `simple-type-error`.
-
Raymond Toy authored
-
Raymond Toy authored
-
Raymond Toy authored
We now signal a `reader-error` on a FP underflow. Thus, test that we get a reader error. Also test that the message says we got an underflow. This is to verify that we tell the user that it's an underflow and not some other reader error.
-
Raymond Toy authored
Undo some tab vs space changes at the end of make-float-aux. The comment about double-float exponent range was in the wrong place so put it in the right place.
-
Raymond Toy authored
Instead of just saying "Underflow when reading...", say "Floating point underflow when reading..." to make it a bit clearer what happened.
-
Raymond Toy authored
The error message makes it clear we have a FP underflow like so: ``` * 1d-308 Reader error on #<Two-Way Stream, Input = #<Synonym Stream to SYSTEM:*STDIN*>, Output = #<Synonym Stream to SYSTEM:*STDOUT*>>: Underflow when reading "1d-308" [Condition of type READER-ERROR] Restarts: 0: [CONTINUE] Return 0.0d0 1: [ABORT ] Return to Top-Level. ```
-
- Mar 26, 2024
-
-
Raymond Toy authored
Actually need to remove `with-float-traps-masked`. Duh!
-
Raymond Toy authored
-
Raymond Toy authored
-
- Mar 23, 2024
-
-
Raymond Toy authored
-
Raymond Toy authored
If the floating-point underflow trap is enabled, signal an underflow error when the number would underflow to a denormal. We still signal a reader-error if the number would not fit in a float.
-
Raymond Toy authored
For large numbers that weren't caught the with the rough check, the conversion of the large ratio to a float signals a `simple-type-error` from `coerce`. We need to catch that and signal a `reader-error`.
-
Raymond Toy authored
We don't need to try to round small numbers to least positive float here. When #277 was fixed, this was taken care of. Hence we can remove all the code for that and just throw a reader-error immediately if the result is 0 but the number is not zero.
-