File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1265,16 +1265,22 @@ let bigint_comp (cmp : Lam_compat.comparison) ?comment (e0: t) (e1: t) =
1265
1265
bin ?comment (Lam_compile_util. jsop_of_comp cmp) e0 e1
1266
1266
1267
1267
let bigint_div ~checked ?comment (e0 : t ) (e1 : t ) =
1268
- if checked then
1269
- runtime_call Js_runtime_modules. bigint " div" [e0; e1]
1270
- else
1271
- bigint_op ?comment Div e0 e1
1268
+ match e1.expression_desc with
1269
+ | Number (Bigint { i = i1 } ) when i1 = " 0" || i1 = " -0" ->
1270
+ if checked then
1271
+ runtime_call Js_runtime_modules. bigint " div" [e0; e1]
1272
+ else
1273
+ bigint_op ?comment Div e0 e1
1274
+ | _ -> bigint_op ?comment Div e0 e1
1272
1275
1273
1276
let bigint_mod ~checked ?comment (e0 : t ) (e1 : t ) =
1274
- if checked then
1275
- runtime_call Js_runtime_modules. bigint " mod_" [e0; e1]
1276
- else
1277
- bigint_op ?comment Mod e0 e1
1277
+ match e1.expression_desc with
1278
+ | Number (Bigint { i = i1 } ) when i1 = " 0" || i1 = " -0" ->
1279
+ if checked then
1280
+ runtime_call Js_runtime_modules. bigint " mod_" [e0; e1]
1281
+ else
1282
+ bigint_op ?comment Mod e0 e1
1283
+ | _ -> bigint_op ?comment Mod e0 e1
1278
1284
1279
1285
(* TODO -- alpha conversion
1280
1286
remember to add parens..
You can’t perform that action at this time.
0 commit comments