Unicode polynomial equation: Difference between revisions

m
Add the "0" polynomial test case.
m (fix typo)
m (Add the "0" polynomial test case.)
Line 18:
|+ Examples of original polynomial text to be parsed.
|-
!Description|| Input Exampleexample test cases
|-
|"Zero" coefficients are removed||x⁵ - 2x⁴ + 42x³ + 0x² + 40x + 1
|-
|The "0" polynomial case||0e+0x⁰⁰⁷ + 00e-00x + 0x + .0x⁰⁵ - 0.x⁴ + 0×x³ + 0x⁻⁰ + 0/x + 0/x³ + 0x⁻⁵
|-
|"One" coefficients are normalised||1x⁵ - 2x⁴ + 42x³ + 40x + 1x⁰
Line 30 ⟶ 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|·]])
|-
|Terms with negative exponents are parsed and stored||x⁻⁵ - 2⁄x⁻⁴2⁄x⁴ + 42x⁻³ + 40/x + 11x⁻⁰ (n.b. [[wp:Unicode_numerals#Fractions|Unicode Fraction]])
|-
|Spaces in numbers and between operators are ignored||x⁵ - 2x⁴ + 42.000 000x³ + 40x + 1
Line 36 ⟶ 38:
|Single commas are ignored in numbers||x⁵ - 2x⁴ + 0,042x³ + 40.000,000x + 1
|-
|A coefficient may be duplicated, zero, or missing||0x⁸0x⁷ + 10x + 10x + x⁵ - 2x⁴ + 42x³ + 20x + 1
|-
|Support [[wp:Scientific_notation#Examples_and_alternatives|Scientific notation]] and optionally<BR>support [http://unicode.org/charts/PDF/U2300.pdf Unicode Decimal Exponent Symbol] [http://mailcom.com/unicode/DecimalExponent.ttf U+23E8/⏨]
||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.
|-
|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.