Skip to content

Instantly share code, notes, and snippets.

@wooningeire
Created May 29, 2023 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooningeire/f73b04229868ac61941e0c6fbf295dbb to your computer and use it in GitHub Desktop.
Save wooningeire/f73b04229868ac61941e0c6fbf295dbb to your computer and use it in GitHub Desktop.
Absolutely incredible math notation parsing feature in JavaScript (from 2018-10-06)
parseInt(`
17 ⎧ ⎢ ___ ⎥ ⎫
⎲ ⎪ ⎢⎹ x̲² ⎥ ⎪
⎳ ⎩ ⎣⎷ x ⎦ ⎭ + 1
x = 1`,
0o44);
// 43
// Verify it: https://www.wolframalpha.com/input?i2d=true&i=Sum%5BFloor%5C%2891%29Sqrt%5BDivide%5BPower%5Bx%2C2%5D%2Cx%5D%5D%5C%2893%29%2C%7Bx%2C1%2C17%7D%5D%2B1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment