Jump to content

Unicode polynomial equation: Difference between revisions

m
misc tidy of desc
(Normalise a polynomial: e.g. x⁵ - 2x⁴ + 42x³ + 40x + 1)
 
m (misc tidy of desc)
Line 1:
{{Template:Draft task}}<!--{{Wikipedia|Polynomial}}-->
The objective of this task is to parse in a difficult [[wp:polynomial|polynomial]], and generate a "pretty" representation of the polynomial in Unicode.
 
In the target language define a "[[wp:polynomial|polynomial]]" object (or structure or record). Using this object also define the routines for parsing a polynomial as input, and generating a normalised [[wp:Unicode|Unicode]] representation of the polynomial as output.
 
'''Task details:'''
Line 24:
|"One" coefficients are normalised||1x⁵ - 2x⁴ + 42x³ + 40x + 1x⁰
|-
|Signs are normalised||+x⁺⁵ + -2x⁻⁻⁴ + 42x⁺⁺³ + +40x - -1
|-
|ASCII representations are parsed||x^5 - 2x**4 + 42x^3 + 40x + 1
|-
|Non-ASCII representations are parsed||x⁵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 + 1 (n.b. [[wp:Unicode_numerals#Fractions|Unicode Fraction]])
Line 36:
|Single commas are ignored in numbers||x⁵ - 2x⁴ + 0,042x³ + 40.000,000x + 1
|-
|A coefficient may be duplicated, zero, ofor missing||0x⁸ + 10x + 10x + x⁵ - 2x⁴ + 42x³ + 20x + 1
|-
|Support Scientific notation<br> and optionally optionall<BR>support [http://unicode.org/charts/PDF/U2300.pdf Unicode Decimal Exponent Symbol] [http://mailcom.com/unicode/DecimalExponent.ttf U+23E8/⏨]
||1E0x⁵ - 2e0x⁴ + 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 decimal the to appropriate fraction.
|}
There are (at least) three possible ways of achieving this task.
Line 49:
* Using a built-in parsing/formatting library.
* Coding a custom polynomial parsing routing.
Either one, or all of these approaches are acceptableaccepted and appear as a subtitle.
[[Category:Mathematics]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.