fix exponent precedence

This commit is contained in:
Book-reader 2025-09-05 21:09:31 +12:00
parent 4f6063bf72
commit 9c9172d4c9

View file

@ -44,7 +44,7 @@ impl Op {
BinOp::Subtract => 1.0, BinOp::Subtract => 1.0,
BinOp::Multiply => 2.0, BinOp::Multiply => 2.0,
BinOp::Divide => 2.0, BinOp::Divide => 2.0,
BinOp::Exponent => 3.0, BinOp::Exponent => 3.1,
}, },
Op::Func(_) => 0.0, // TODO: decide if this is a good LBP Op::Func(_) => 0.0, // TODO: decide if this is a good LBP
} }
@ -59,7 +59,7 @@ impl Op {
BinOp::Subtract => 1.1, BinOp::Subtract => 1.1,
BinOp::Multiply => 2.1, BinOp::Multiply => 2.1,
BinOp::Divide => 2.1, BinOp::Divide => 2.1,
BinOp::Exponent => 3.1, BinOp::Exponent => 3.0,
}, },
Op::Func(_) => 4.0, // TODO: decide if this is a good RBP Op::Func(_) => 4.0, // TODO: decide if this is a good RBP
} }