mirror of
https://github.com/storytold/gridcraft.git
synced 2026-12-01 18:26:05 -06:00
dax: note that Excel agrees on left-associative exponentiation (#2228)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user