Unicode polynomial equation: Difference between revisions

Content added Content deleted
m (Add the "0" polynomial test case.)
(Specifically permit non-polynomials where terms have negative exponents)
Line 32: Line 32:
|Non-ASCII representations are parsed||x↑5 - 2.00·x⁴ + 42.00·x³ + 40.00·x + 1 (c.f. [[wp:Knuth's up-arrow notation|↑]] & [[wp:·#In_mathematics_and_science|·]])
|Non-ASCII representations are parsed||x↑5 - 2.00·x⁴ + 42.00·x³ + 40.00·x + 1 (c.f. [[wp:Knuth's up-arrow notation|↑]] & [[wp:·#In_mathematics_and_science|·]])
|-
|-
|Terms with negative exponents are parsed and stored||x⁻⁵ - 2⁄x⁴ + 42x⁻³ + 40/x + 1x⁻⁰ (n.b. [[wp:Unicode_numerals#Fractions|Unicode Fraction]])
|Specifically permit non-polynomials where terms have negative exponents||x⁻⁵ - 2⁄x⁴ + 42x⁻³ + 40/x + 1x⁻⁰ (n.b. [[wp:Unicode_numerals#Fractions|Unicode Fraction]])
|-
|-
|Spaces in numbers and between operators are ignored||x⁵ - 2x⁴ + 42.000 000x³ + 40x + 1
|Spaces in numbers and between operators are ignored||x⁵ - 2x⁴ + 42.000 000x³ + 40x + 1
Line 43: Line 43:
||1E0x⁵ - 2,000,000.e-6x⁴ + 4.2⏨1x³ + .40e+2x + 1
||1E0x⁵ - 2,000,000.e-6x⁴ + 4.2⏨1x³ + .40e+2x + 1
|-
|-
|Support the set minimum of Unicode characters as follows: ||⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁻ ⁺ · × ⁄ .<br>Where × & × are multiplication, and ⁄ is Unicode Fraction.
|Unicode characters that must be specifically supported are: ||⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁻ ⁺ · × ⁄ ↑ ⏨.<br>Where · & × are multiplication, and ⁄ is Unicode Fraction.
|-
|Support fractions for both input and output. || x⁵ - x⁴⁄2 + 405x³⁄4 + 403x⁄4 + 5⁄2<BR>On output round the decimal to appropriate fraction.
|-
|-
|Optionally support [[wp:Number Forms|Unicode Vulgar fractions]] for both input and output.<BR>¼ ½ ¾ ⅐ ⅑ ⅒ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ ↉ || x⁵ - ½x⁴ + 101¼x³ + 100¾x + 2½<BR>On output round the decimal to appropriate fraction.
|Optionally support [[wp:Number Forms|Unicode Vulgar fractions]] for both input and output.<BR>¼ ½ ¾ ⅐ ⅑ ⅒ ⅓ ⅔ ⅕ ⅖ ⅗ ⅘ ⅙ ⅚ ⅛ ⅜ ⅝ ⅞ ↉ || x⁵ - ½x⁴ + 101¼x³ + 100¾x + 2½<BR>On output round the decimal to appropriate fraction.
|}
|}

There are (at least) three possible ways of achieving this task.
There are (at least) three possible ways of achieving this task.
* Using an external parsing library.
* Using an external parsing library.