From ef6244dc846e27105ca6767bf718f8b85e9eec70 Mon Sep 17 00:00:00 2001 From: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> Date: Fri, 3 Jul 2026 11:25:29 +0300 Subject: [PATCH] exp() silently evaluated as a no-op MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "exp" was also listed as a scientific-notation alias ("123456 in exp"). Phrases register first-come-first-served, and that alias was registered before the exp() function, so the function itself never got the phrase — exp(1) parsed as a bare (1) and returned 1. Drop exp from the scientific-notation aliases; sci/exponent/exponential still work. --- src/engine/edge.test.ts | 8 ++++++++ src/engine/vocab-data.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/engine/edge.test.ts b/src/engine/edge.test.ts index 6c82046..06c10b2 100644 --- a/src/engine/edge.test.ts +++ b/src/engine/edge.test.ts @@ -224,4 +224,12 @@ describe("review fixes", () => { expect(calc("$12 * 3")).toBe("$36"); expect(calc("2 m * 3 m")).toBe("6 m²"); }); + it("exp(x) is Euler's number to the power x, not scientific notation", () => { + expect(calc("exp(1)")).toBe("2.72"); + expect(calc("exp(0)")).toBe("1"); + }); + it("scientific notation still works via sci/exponent/exponential", () => { + expect(calc("123456 in scientific")).toBe("1.23e5"); + expect(calc("123456 in exponent")).toBe("1.23e5"); + }); }); diff --git a/src/engine/vocab-data.ts b/src/engine/vocab-data.ts index aaebe90..2e22c1a 100644 --- a/src/engine/vocab-data.ts +++ b/src/engine/vocab-data.ts @@ -410,7 +410,7 @@ export const EN: VocabLocale = { "decimal.variants": "decimal,dec", "hex.variants": "hex", "octal.variants": "octal", - "scientific.variants": "scientific, sci, exp, exponent, exponential" + "scientific.variants": "scientific, sci, exponent, exponential" }, "Operations": { "assignment.variants": "equal,is",