File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 274
274
case A_TO :
275
275
val = D_ARG (2 );
276
276
if (IS_DECIMAL (val ) || IS_PERCENT (val )) {
277
- if (VAL_DECIMAL (val ) < MIN_D64 || VAL_DECIMAL (val ) >= MAX_D64 )
277
+ if (VAL_DECIMAL (val ) < MIN_D64 || VAL_DECIMAL (val ) >= MAX_D64 || isnan ( VAL_DECIMAL ( val )) )
278
278
Trap0 (RE_OVERFLOW );
279
279
num = (REBI64 )VAL_DECIMAL (val );
280
280
}
Original file line number Diff line number Diff line change @@ -140,6 +140,14 @@ Rebol [
140
140
;@@ https://github.com/Oldes/Rebol-issues/issues/2099
141
141
--assert 302961000000 = to integer! "3.02961E+11"
142
142
143
+ --test-- "make/to integer! 1.#NaN and 1.#INF"
144
+ --assert error? try [to integer! 1. #NaN ]
145
+ --assert error? try [to integer! 1. #INF ]
146
+ --assert error? try [to integer! -1. #INF ]
147
+ --assert error? try [make integer! 1. #NaN ]
148
+ --assert error? try [make integer! 1. #INF ]
149
+ --assert error? try [make integer! -1. #INF ]
150
+
143
151
===end-group===
144
152
145
153
===start-group=== "make/to decimal!"
You can’t perform that action at this time.
0 commit comments