File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 226
226
case A_ADD : v += a ; break ;
227
227
case A_SUBTRACT : v -= a ; break ;
228
228
case A_MULTIPLY :
229
- if (IS_DECIMAL (arg ) || IS_PERCENT (arg ))
229
+ if ( v == 0 ) break ;
230
+ if (IS_DECIMAL (arg ) || IS_PERCENT (arg )) {
231
+ if (dec > 255.0 ) {
232
+ * vp = (REBYTE )255 ;
233
+ continue ;
234
+ }
230
235
v = (REBI64 )(v * dec );
231
- else
236
+ } else {
237
+ if (a > 255 ) {
238
+ * vp = (REBYTE )255 ;
239
+ continue ;
240
+ }
232
241
v *= a ;
242
+ }
233
243
break ;
234
244
case A_DIVIDE :
235
245
if (IS_DECIMAL (arg ) || IS_PERCENT (arg )) {
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Rebol [
19
19
20
20
--test-- "tuple multiply"
21
21
--assert (1.1.1 * 2147483648.0 ) == 255.255.255
22
+ --assert (1.1.1 * 4.656612873077e+100 ) == 255.255.255
23
+ --assert (1.1.1 * 4656612873077 ) == 255.255.255
24
+ --assert (0.0.0 * 4656612873077 ) == 0.0.0
22
25
23
26
===end-group===
24
27
You can’t perform that action at this time.
0 commit comments