3 i parses as 3 ^ i, not 3 * i, so sin(3 i) is evaluated at 3^i (about 0.455 + 0.891i):
"sin(3 i)".ToEntity() -> sin(3 ^ i)
"x i".ToEntity() -> x ^ i
"(1 + 2) i".ToEntity() -> (1 + 2) ^ i
"2 i x".ToEntity() -> 2 ^ i * x
2.5.0 does the same. The juxtaposition rule inserts ^ before a number written after a number, a name or ), so that x2 is x ^ 2. The lexer reads i as a number, so the rule applies to it as well. Syntax.md records this as a consequence of the rule since #1041, and SyntaxDocumentedTest pins "x i" as "x ^ i".
Proposal: an imaginary literal written after a factor is a factor too. 3 i would be 3 * i and x 2i would be x * 2i, while x2, 3 2 and (x + 1)2 stay powers. 3i, written as one literal, is already 3i. I'd change the rule and the documented row together. Is that the reading you want?
3 iparses as3 ^ i, not3 * i, sosin(3 i)is evaluated at3^i(about0.455 + 0.891i):2.5.0 does the same. The juxtaposition rule inserts
^before a number written after a number, a name or), so thatx2isx ^ 2. The lexer readsias a number, so the rule applies to it as well.Syntax.mdrecords this as a consequence of the rule since #1041, andSyntaxDocumentedTestpins"x i"as"x ^ i".Proposal: an imaginary literal written after a factor is a factor too.
3 iwould be3 * iandx 2iwould bex * 2i, whilex2,3 2and(x + 1)2stay powers.3i, written as one literal, is already3i. I'd change the rule and the documented row together. Is that the reading you want?