dax: note that Excel agrees on left-associative exponentiation (#2228)

This commit is contained in:
alosslessdev
2026-11-05 12:33:44 -05:00
parent 6f965710c0
commit 0f074e4702
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -219,8 +219,8 @@ operator was written. `IN` is a comparison at the same level as `=`, so `1 + 2 I
Microsoft's operator reference states that operators of equal precedence are ordered from left to
right, and `^` shares no tier with another operator, so a chain groups left: `2^3^2` is `(2^3)^2` =
64. (Excel's worksheet engine answers 512 for the same text; this crate follows DAX.) Unary minus
binds looser than `^`: `-2^2` parses as `-(2^2)`.
64, the value Excel and Power Pivot produce as well. Unary minus binds looser than `^`: `-2^2` parses
as `-(2^2)`.
## Data types and static inference
+1 -2
View File
@@ -231,8 +231,7 @@ impl BinaryOp {
/// DAX binary operators all associate to the left. Microsoft's operator reference puts `^` in
/// its own precedence tier and states that operators of equal precedence are ordered from left
/// to right, so `2^3^2` is `(2^3)^2` = 64. (Excel's worksheet engine groups the chain the other
/// way and answers 512; this crate implements DAX.)
/// to right, so `2^3^2` is `(2^3)^2` = 64 — the same value Excel and Power Pivot produce.
pub const fn is_left_associative(self) -> bool {
true
}