-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sub): error instead of panic when subtraction yields NaN (#1186)
* fix(sub): panic when diffing inf floats * cargo fmt * clippy fix * clippy fix * changelog
- Loading branch information
Showing
3 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a panic in float subtraction that produces NaN values. |
5 changes: 5 additions & 0 deletions
5
lib/tests/tests/expressions/arithmetic/subtraction/nan_result.vrl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# result: can't subtract type float from float | ||
|
||
large = to_float!("1.7976931348623157e+308") | ||
inf_float = large + large | ||
inf_float - inf_float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters