Commit 7bef2ac
committed
Fix cross-platform inconsistency in casting double.PositiveInfinity to int
When casting (int)double.PositiveInfinity, Windows returns -2147483648 (Int32.MinValue), while Unix-based systems return 2147483647 (Int32.MaxValue).
This behavior leads to inconsistent results in calculations across platforms. An additional check has been added to standardize the behavior and ensure consistent results regardless of the operating system.1 parent d5d3c47 commit 7bef2ac
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
0 commit comments