Created
May 29, 2023 04:21
-
-
Save wooningeire/f73b04229868ac61941e0c6fbf295dbb to your computer and use it in GitHub Desktop.
Absolutely incredible math notation parsing feature in JavaScript (from 2018-10-06)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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