Last active
February 3, 2017 12:33
-
-
Save butchi/8c7370bc84f6b5e3a49a5972ce691091 to your computer and use it in GitHub Desktop.
MathML簡略化案
This file contains hidden or 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
# https://ja.wikipedia.org/wiki/Mathematical_Markup_Language | |
```replace-list--math-ml | |
replace mrow(/(.+)/) -> ($1) | |
replace mfrac(/(.+) (.+)/) -> ($1 / $2) | |
replace msup(/(.+) (.+)/) -> ($1 ^ $2) | |
replace msqrt(/(.+)/) -> √($1) | |
replace mi(/([a-z]+)/) -> $1 | |
replace mn(([1-9][0-9]*)) -> $1 | |
replace mo(=) -> = | |
replace mo(-) -> - | |
replace mo(⁢) -> | |
replace mo(±) -> ± | |
``` | |
```math | |
include replace-list--math-ml | |
return (x=(((-b)±√((b ^ 2)-(4 a c)))/(2 a))) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment