mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 03:31:12 +08:00
feat: 二元幂运算 opcode 支持 number 与 BigInt
- 新增 EXP opcode(0x94)与 emit 层 Exponential 分支,二元 a ** b 不再 compile error - dispatch_exp 与 dispatch_compound_exp 共享 exp_result:IEEE-754 powf 快路径 + BigInt 幂(负/超 u32 指数 RangeError)+ 混合 BigInt/Number TypeError - 复合 **= 补 BigInt 语义(此前走 f64 近似),与二元 ** 行为一致
This commit is contained in:
@@ -1470,6 +1470,10 @@ impl Vm {
|
||||
binary_arith!(self, a, b, rd, %, true);
|
||||
}
|
||||
|
||||
OpCode::EXP => {
|
||||
self.dispatch_exp(rd, a, b)?;
|
||||
}
|
||||
|
||||
OpCode::NEG => {
|
||||
self.dispatch_neg(rd, a)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user