Point Notation: Difference between revisions
(21 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td valign="baseline">e.g., <apll>2< | <td valign="baseline">e.g., <apll>2<_pi/>3</apll> as a shorthand for <apll>2∙π<sup>3</sup></apll> or <apll>2×(○1)*3</apll>.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 33: | Line 33: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td valign="baseline">e.g., <apll>2<_z/>3</apll> as a shorthand for 2∙ζ(3) where ζ(x) is the [https://en.wikipedia.org/wiki/Riemann_zeta_function Riemann Zeta function].</td> | <td valign="baseline">e.g., <apll>2<_z/>3</apll> as a shorthand for <apll>2∙ζ(3)</apll> where <apll>ζ(x)</apll> is the [https://en.wikipedia.org/wiki/Riemann_zeta_function Riemann Zeta function].</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td valign="baseline"><b>Complex | <td valign="baseline"><b>Complex Angle Point Notation</b>:</td> | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td valign="baseline">e.g., <apll>2<_ad/>3</apll> (Angle in Degrees), <apll>2<_ar/>3</apll> (Angle in Radians), <apll>2<_au/>3</apll> (Angle in Unit Normalized Radians), or <apll>2<_ah/>0.3</apll> (Angle in Half Unit Normalized Radians).</td> | |||
<td valign="baseline">e.g., <apll>2<_ad/>3</apll> (Angle in Degrees), <apll>2<_ar/>3</apll> (Angle in Radians), <apll>2<_au/>3</apll> (Angle in Unit Normalized Radians), or <apll>2<_ah/>3</apll> (Angle in Half Unit Normalized Radians).</td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 51: | Line 45: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td valign="baseline">e.g., <apll>1<_i/>2< | <td valign="baseline">e.g., <apll>1<_i/>2<_j/>3<_k/>4</apll> for a Quaternion number, or <apll>1<_i/>2<_j/>3<_k/>4<l/>5<_ij/>6<_jk/>7<_kl/>8</apll> for an Octonion number.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 63: | Line 57: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td valign="baseline">e.g., <apll>2<_r/>3</apll> as a shorthand for <apll>2÷3</apll> as an infinite precision rational number, or <apll>123<_x/></apll> as a means of representing <apll>123</apll> as an infinite precision integer — the suffix <apll><_x/></apll> is actually a shorthand for <apll><_r/>1</apll>, that is, infinite precision integers are actually represented as rational numbers with a denominator of <apll>1</apll>.</td> | <td valign="baseline">e.g., <apll>2<_r/>3</apll> as a shorthand for <apll>2÷3</apll> as an infinite precision rational number, or <apll>123<_x/></apll> as a means of representing <apll>123</apll> as an infinite precision integer — the suffix <apll><_x/></apll> is actually a shorthand for <apll><_r/>1</apll>, that is, infinite precision integers are actually represented as rational numbers with a denominator of <apll>1</apll>. However, this suffix cannot be used anywhere in the lefthand part(s) of any other notation.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 87: | Line 81: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, and <b>Rational</b> Point Notations are extensions to the familiar <b>Decimal</b> Point Notation as well as <b>Exponential</b> Point or Scientific Notation methods of entering numeric constants. Thanks to the designers of J for these clever [http://www.jsoftware.com/help/dictionary/dcons.htm ideas].</td> | <td><b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, <b>Zeta</b> and <b>Rational</b> Point Notations are extensions to the familiar <b>Decimal</b> Point Notation as well as <b>Exponential</b> Point or Scientific Notation methods of entering numeric constants. Thanks to the designers of J for these clever [http://www.jsoftware.com/help/dictionary/dcons.htm ideas].</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
Line 96: | Line 90: | ||
This notation makes it easy to enter numeric constants in an arbitrary base. | This notation makes it easy to enter numeric constants in an arbitrary base. | ||
The number to the left of the <apll>< | The number to the left of the <apll><_b/></apll> is the base of the number system for the characters to the right of the <apll><pn>b</pn></apll>. The base may be represented in several ways including integers, <b>Exponential</b>, <b>Decimal</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, <b>Zeta</b>, '''Complex''', <b>Hypercomplex</b>, <b>Rational</b>, and <b>Variable Precision Floating</b> Point Notation, but not <b>Base</b> Point Notation. | ||
For example, <apll>1< | For example, <apll>1<_E/>3<_b/>111</apll> is the same as <apll>1000<_b/>111</apll>. | ||
Note that the base may also be negative as in <apll>¯1< | Note that the base may also be negative as in <apll>¯1<_b/>0z</apll>, fractional as in <apll>0.1<_b/>1234</apll>, '''Complex''', or '''Hypercomplex''' as in <apll>0<pn>J</pn>1<_b/>321</apll>. | ||
The characters to the right of the <apll><pn>b</pn></apll> may range from <b>0-9</b> or <b>a-z</b> where the latter range is a way of representing numbers from <b>10-35</b> in a single character. The uppercase letters (<b>A-Z</b>) have the same values as the corresponding lowercase case letters and may be used instead of or intermixed with them. | The characters to the right of the <apll><pn>b</pn></apll> may range from <b>0-9</b> or <b>a-z</b> where the latter range is a way of representing numbers from <b>10-35</b> in a single character. The uppercase letters (<b>A-Z</b>) have the same values as the corresponding lowercase case letters and may be used instead of or intermixed with them. | ||
For example, <apll>10< | For example, <apll>10<_b/>zzZz</apll> is the same as <apll>10⊥35 35 35 35</apll>, and <apll>1<pn>r</pn>2<_b/>111</apll> is the same as <apll>0.5<_b/>111</apll> except for precision — the former is Multiple-Precision and the latter is Fixed. | ||
A decimal point may appear anywhere in the characters to the right of the <apll>< | A decimal point may appear anywhere in the characters to the right of the <apll><_b/></apll> to indicate that the characters to its right represent the fractional part of the number in the given base. | ||
Finally, the characters to the right of the <apll>< | Finally, the characters to the right of the <apll><_b/></apll> may start with a negative sign (as in <apll>2<_b/>¯101 ←→ ¯5</apll>) which negates the entire result. | ||
For example, <apll>2< | For example, <apll>2<_b/>111.111</apll> is <apll>(6⍴1)+.×2*2..¯3</apll> which is <apll>7.875</apll>. | ||
== Euler Point Notation == | == Euler Point Notation == | ||
This notation allows you to enter numeric constants that are in the form of the product of a | This notation allows you to enter numeric constants that are in the form of the product of a '''M'''ultiplier and <apll>e</apll> (<apll>≅ 2.718281828459045...</apll> — base of the natural logarithms) raised to an '''E'''xponent, that is, <apll>M∙e<sup>E</sup></apll> or <apll>M×(*1)*E</apll>. The numbers to the left (multiplier) and right (exponent) of the <apll><pn>x</pn></apll> may be represented in several ways including integers, <b>Decimal</b>, <b>Exponential</b>, '''Complex''', <b>Hypercomplex</b>, <b>Rational</b>, or <b>Variable Precision Floating</b> Point Notation, but not <b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notation. | ||
For example, <apll>1< | For example, <apll>1<_e/>2<_x/>1.1</apll> is the same as <apll>100<_x/>1.1</apll>, and <apll>1<_r/>2<_x/>1.1<_e/>2</apll> is the same as <apll>0.5<_x/>110</apll>. | ||
Both the multiplier and exponent may be negative and/or fractional as in <apll>¯1< | Both the multiplier and exponent may be negative and/or fractional as in <apll>¯1<_e/>2<_x/>¯3.3</apll>. | ||
== Pi Point Notation == | == Pi Point Notation == | ||
This notation allows you to enter numeric constants that are in the form of the product of a | This notation allows you to enter numeric constants that are in the form of the product of a '''M'''ultiplier and <apll>π</apll> (<apll>≅ 3.141592653589793...</apll> — ratio of a circle's circumference and diameter) raised to an '''E'''xponent, that is, <apll>M∙π<sup>E</sup></apll> or <apll>M×(○1)*E</apll>. The numbers to the left (multiplier) and right (exponent) of the <apll><_pi/></apll> may be represented in several ways including integers, <b>Decimal</b>, <b>Exponential</b>, <b>Complex</b>, <b>Hypercomplex</b>, <b>Rational</b>, or <b>Variable Precision Floating</b> Point Notation, but not <b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notation. | ||
For example, <apll>1< | For example, <apll>1<_e/>2<_pi/>1.1</apll> is the same as <apll>100<_pi/>1.1</apll>, and <apll>1<_r/>2<_pi/>1.1<_e/>2</apll> is the same as <apll>0.5<_pi/>110</apll>. | ||
Both the multiplier and exponent may be negative and/or fractional as in <apll>¯1< | Both the multiplier and exponent may be negative and/or fractional as in <apll>¯1<_e/>2<_pi/>¯3.3</apll>. | ||
== Gamma Point Notation == | == Gamma Point Notation == | ||
This notation allows you to enter numeric constants that are in the form of the product of a | This notation allows you to enter numeric constants that are in the form of the product of a '''M'''ultiplier and <apll>γ</apll> (<apll>≅ 0.5772156649015329...</apll> — limiting difference between the harmonic series and the natural logarithm) raised to an '''E'''xponent, that is, <apll>M∙γ<sup>E</sup></apll> or <apll>M×γ*E</apll>. The numbers to the left (multiplier) and right (exponent) of the <apll><pn>g</pn></apll> may be represented in several ways including integers, <b>Decimal</b>, <b>Exponential</b>, <b>Complex</b>, <b>Hypercomplex</b>, <b>Rational</b>, or <b>Variable Precision Floating</b> Point Notation, but not <b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notation. | ||
For example, <apll>1< | For example, <apll>1<_e/>2<_g/>1.1</apll> is the same as <apll>100<_g/>1.1</apll>, and <apll>1<_r/>2<_g/>1.1<_e/>2</apll> is the same as <apll>0.5<_g/>110</apll>. | ||
Both the multiplier and exponent may be negative and/or fractional as in <apll>{overbar}1< | Both the multiplier and exponent may be negative and/or fractional as in <apll>{overbar}1<_e/>2<_g/>¯3.3</apll>. | ||
== Zeta Point Notation == | == Zeta Point Notation == | ||
This notation allow you to enter numbers that are in the form of the product of a | This notation allow you to enter numbers that are in the form of the product of a '''M'''ultiplier and an '''A'''rgument passed to a call to <apll>ζ(x)</apll> the [https://en.wikipedia.org/wiki/Riemann_zeta_function Riemann Zeta function], that is, <apll>M∙ζ(A)</apll>. The numbers to the left (multiplier) and right (argument) of the <apll><_z/></apll> may be represented in several ways including integers, <b>Decimal</b>, <b>Exponential</b>, <b>Rational</b>, or <b>Variable Precision Floating</b> Point Notation, but not <b>Base</b>, <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notation. At the moment, although the Zeta function is defined throughout the Complex plane, only the Ball Arithmetic version allows a Complex argument. | ||
For example, | |||
<ul> | |||
<li><apll>1<_z/>2</apll> is the constant <apll>1<_pi/>2÷6</apll> (<apll>≅ 1.64493406684822643647241516664602518921...</apll>)</li> | |||
<li><apll>1<_z/>3</apll> is known as [https://en.wikipedia.org/wiki/Ap%C3%A9ry%27s_constant Apéry's constant]</li> | |||
<li><apll>1<_z/>2<_i/>3<_pom/></apll> which calculates <apll>ζ(2+3i)</apll></li> | |||
</ul> | |||
<div id="Angle_Point_Notation"></div> | |||
== Hypercomplex and Complex Angle Point Notation == | |||
'''Hypercomplex''' Point Notation allows you to enter Complex, Quaternion, and Octonion numbers in various forms as a combination of a '''Real''' part followed by one or more '''Imaginary''' parts (2nd, 4th, or 8th roots of <apll>¯1</apll>) each separated by the corresponding notation. For example, | |||
<table> | |||
<tr> | |||
<td><apll>1<_i/>2</apll></td> | |||
<td>Complex</td> | |||
</tr> | |||
<tr> | |||
<td><apll>1<_i/>2<_j/>3<_k/>4</apll></td> | |||
<td>Quaternion</td> | |||
</tr> | |||
<tr> | |||
<td><apll>1<_i/>2<_j/>3<_k/>4<_l/>5<_ij/>6<_jk/>7<_kl/>8</apll></td> | |||
<td>Octonion</td> | |||
</tr> | |||
</table> | |||
For more details, see [http://www.sudleyplace.com/APL/Hypercomplex%20Notation%20in%20APL.pdf Hypercomplex Notation in APL]. | |||
'''Complex | '''Complex Angle''' Point Notation, as in <apll>1.2<_ad/>0.25</apll>, contains two parts: the Radius <apll>1.2</apll> and the Angle <apll>0.25</apll>, which may be expressed in one of four units such as '''Degrees''', '''Radians''', etc., all measured in a counter-clockwise direction from the x-axis, which is <apll>0</apll> in the corresponding unit. | ||
The | The Angle Domain and Units of the several '''Complex Angle''' notations is as follows: | ||
{| | {| | ||
|'''Notation''' | |'''Notation''' | ||
| | | | ||
|'''Domain | |'''Angle Domain''' | ||
| | | | ||
|align="left"|'''Angle Units''' | |align="left"|'''Angle Units''' | ||
|- | |- | ||
|align="center"|<_ad/>|| ||<apll>[¯360, 360]</apll>|| ||Degrees | |align="center"|<apll><_ad/></apll>|| ||<apll>[¯360, 360]</apll>|| ||Degrees | ||
|- | |- | ||
|align="center"|<_ar/>|| ||<apll>[¯2p1, 2p1]</apll>|| ||Radians | |align="center"|<apll><_ar/></apll>|| ||<apll>[¯2p1, 2p1]</apll>|| ||Radians | ||
|- | |- | ||
|align="center"|<_au/>|| ||<apll>[0, 1]</apll>|| ||Unit Normalized Radians | |align="center"|<apll><_au/></apll>|| ||<apll>[0, 1]</apll>|| ||Unit Normalized Radians | ||
|- | |- | ||
|align="center"|<_ah/>|| ||<apll>[¯0.5, 0.5]</apll>|| ||Half Unit Normalized Radians | |align="center"|<apll><_ah/></apll>|| ||<apll>[¯0.5, 0.5]</apll>|| ||Half Unit Normalized Radians | ||
|- | |- | ||
|} | |} | ||
Entering a number whose Angle is outside the associated | Entering a number whose Angle is outside the associated Domain, signals an error. | ||
== Ball Arithmetic Point Notation == | == Ball Arithmetic Point Notation == | ||
This notation allows you to enter '''Ball Arithmetic''' point values. A Ball consists of a '''Midpoint''' and a '''Radius'''. The two values are separated by a plus-or-minus sign (<apll>< | This notation allows you to enter '''Ball Arithmetic''' point values. A Ball consists of a '''Midpoint''' and a '''Radius'''. The two values are separated by a plus-or-minus sign (<apll><_pom/></apll>) as in <apll>2.3<_pom/>1<_E/>¯9</apll>. If the Radius is zero, it may be omitted. | ||
Ball Arithmetic numbers may also be used as a lefthand part of <b>Base</b>, and any part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, '''Complex''', or <b>Hypercomplex</b> Point Notations. For more information, see [[Ball Arithmetic]]. | Ball Arithmetic numbers may also be used as a lefthand part of <b>Base</b>, and any part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, <b>Zeta</b>, '''Complex''', or <b>Hypercomplex</b> Point Notations. For more information, see [[Ball Arithmetic]]. | ||
== Rational Point Notation == | == Rational Point Notation == | ||
This notation allows you to enter fractions as rational numbers and have them be retained as rational numbers. Rational numbers | This notation allows you to enter fractions and integers as rational numbers and have them be retained as rational numbers. Rational numbers, using the <apll><_r/></apll> infix notation, may be used in the '''lefthand''' part of <b>Base</b>, and either part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notations. Rational Integers, using the <apll><_x/></apll> suffix notation, may be used in the '''righthand''' part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notations only, not in the '''lefthand''' part; use <apll><_r/>1</apll>, as in <apll>123<_r/>1<_g/>2</apll>, instead of <apll>123<_x/><_g/>2</apll>. | ||
For more information, see [[Rational and VFP Numbers|Rational Numbers]]. This notation also accepts strings that contain '''Decimal''' and/or '''Exponential''' point notation such as <apll>0.3<_x/></apll>, <apll>0.7<_r/>3</apll>, <apll>0.7<_E/>¯3<_r/>1.7</apll>, etc. and represents them as an exact Rational number. | |||
== Variable-Precision Floating Point Notation == | == Variable-Precision Floating Point Notation == | ||
This notation allows you to enter '''Decimal''' and '''Exponential''' point values as variable-precision floating point numbers. For example, <apll>2.3< | This notation allows you to enter '''Decimal''' and '''Exponential''' point values as variable-precision floating point numbers. For example, <apll>2.3<_v/></apll> or <apll>2<_E/>¯3<_v/></apll>. | ||
In this form, the bits of precision of the number is specified by the value of <apll>⎕FPC</apll> at the time the number is fixed. Alternatively, the suffix <apll><pn>v</pn></apll> may be followed by an unsigned integer (<apll>≥53</apll>) to specify the number of bits of precision of the number, overriding the value of <apll>⎕FPC</apll>. For example <apll>2.3< | In this form, the bits of precision of the number is specified by the value of <apll>⎕FPC</apll> at the time the number is fixed. Alternatively, the suffix <apll><pn>v</pn></apll> may be followed by an unsigned integer (<apll>≥53</apll>) to specify the number of bits of precision of the number, overriding the value of <apll>⎕FPC</apll>. For example <apll>2.3<_v/>64</apll> is a shorthand for <apll>2.3</apll> as a VFP number with <apll>64</apll> bits of precision. | ||
VFP numbers (using the <apll>< | VFP numbers (using the <apll><_v/></apll> suffix) may also be used as a lefthand part of <b>Base</b>, and either part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, or <b>Zeta</b> Point Notations. For more information, see [[Rational and VFP Numbers|Variable-precision Floating Point (VFP) Numbers]]. | ||
== Exponential Point Notation == | == Exponential Point Notation == | ||
This familiar notation (sometimes called scientific notation) allows you to enter numeric constants that are in the form of the product of a multiplier and a (possibly negative) power of 10. Exponential numbers (using either the <apll>< | This familiar notation (sometimes called scientific notation) allows you to enter numeric constants that are in the form of the product of a multiplier and a (possibly negative) power of 10. Exponential numbers (using either the <apll><_e/></apll> or <apll><_E/></apll> infix separator) may also be used as a lefthand par of <b>Base</b>, and either part of <b>Euler</b>, <b>Pi</b>, <b>Gamma</b>, <b>Zeta</b>, '''Complex''', <b>Hypercomplex</b> Point Notations. | ||
For example, <apll>¯1.1< | For example, <apll>¯1.1<_e/>2</apll> is the same as <apll>¯110.0</apll>, and <apll>1.1<_E/>¯6</apll> is the same as <apll>0.0000011</apll>. | ||
== Decimal Point Notation == | == Decimal Point Notation == | ||
Line 199: | Line 221: | ||
The above notations may be combined in a single '''Point Notation String''' with the restrictions discussed above, a summary of which follows: | The above notations may be combined in a single '''Point Notation String''' with the restrictions discussed above, a summary of which follows: | ||
<ul> | <ul> | ||
<li>The right part of '''Base''' Point Notation may '''not''' contain any of the | <li>The right part of '''Base''' Point Notation may '''not''' contain any of the other Point Notations except for (positive or negative) <b>Decimal</b>.</li> | ||
<li>The left part of '''Base''' Point Notation may contain any of the | <li>The left part of '''Base''' Point Notation may contain any of the other Point Notations except itself and '''Rational Integer''' Point Notation (e.g., <apll>123<_x/></apll> — instead use <apll>123<_r/>1</apll>).</li> | ||
<li>'''Decimal''', '''Exponential''', '''Rational''', '''Variable Precision''', '''Ball''', ''' | <li>'''Decimal''', '''Exponential''', '''Rational''', '''Variable Precision''', '''Ball''', '''Hypercomplex''', and '''Complex Angle''' Point Notations may appear in either or both parts of '''Euler''', '''Pi''', '''Gamma''', or '''Zeta''' Point Notations, except for '''Rational Integer''' Point Notation which may '''not''' appear in the '''lefthand''' part of '''epgz''' notations.</li> | ||
<li>No two of '''Euler''', '''Pi''', or ''' | <li>No two of '''Euler''', '''Pi''', '''Gamma''' , or '''Zeta''' Point Notations may appear in the same Point Notation String.</li> | ||
</ul> | </ul> | ||
For example, <apll>1<_z/>2</apll> is calculated in double-precision (53-bit precision) floating point arithmetic, however, if you need more precision, <apll>1<_z/>2<_x/></apll> is calculated in multiple-precision floating point arithmetic whose precision is set by <apll>⎕FPC</apll>. | |||
<apll><pre> | |||
⎕FPC←128 | |||
1<_z/>2 | |||
1.6449340668482275 | |||
1<_z/>2<_x/> | |||
1.64493406684822643647241516664602518922 | |||
</pre></apll> | |||
In terms of '''Binding Strength''', the Notation with the highest binding strength is '''Decimal'''. That is, '''Decimal''' Point Notation numbers are constructed first. From highest to lowest binding strength, the sequence is as follows: | In terms of '''Binding Strength''', the Notation with the highest binding strength is '''Decimal'''. That is, '''Decimal''' Point Notation numbers are constructed first. From highest to lowest binding strength, the sequence is as follows: | ||
Line 212: | Line 244: | ||
<li>5. Rational, Variable Precision Floating Point | <li>5. Rational, Variable Precision Floating Point | ||
<li>4. Ball Arithmetic | <li>4. Ball Arithmetic | ||
<li>3. Complex | <li>3. Hypercomplex, Complex Angle | ||
<li>2. Euler, Pi, Gamma | <li>2. Euler, Pi, Gamma, Zeta | ||
<li>1. Base | <li>1. Base | ||
</ul> | </ul> | ||
Line 219: | Line 251: | ||
Notations with the same binding strength may not be mixed (e.g., <apll>1<pn>r</pn>2<pn>v</pn></apll> is an error). Otherwise, any notation may incorporate notations with a higher binding strength but may not incorporate notations with an equal or lower binding strength. | Notations with the same binding strength may not be mixed (e.g., <apll>1<pn>r</pn>2<pn>v</pn></apll> is an error). Otherwise, any notation may incorporate notations with a higher binding strength but may not incorporate notations with an equal or lower binding strength. | ||
This latter case need not signal an error, but instead | '''N.B.''': This latter case need not signal an error, but instead might produce a different interpretation. For example, | ||
<apll>1< | <apll>1<_r/>2<_pi/>1<_J/>3</apll> is interpreted as <apll>1<_r/>2×(○1<_x/>)*1<_J/>3</apll> not as <apll>1<_r/>2<_pi/>1+0<_J/>3</apll> because '''Rational''' and '''Hypercomplex''' Point Notations are constructed before '''Pi''' Point Notation is. | ||
{{Language Toolbar}} | {{Language Toolbar}} | ||
[[Category:Mouse Group Notations]] | [[Category:Mouse Group Notations]] |
Latest revision as of 10:52, 10 September 2022
Overview
|
||||||||||||||||||||||||||||||||||||||||||||||||
Base, Euler, Pi, Gamma, Zeta and Rational Point Notations are extensions to the familiar Decimal Point Notation as well as Exponential Point or Scientific Notation methods of entering numeric constants. Thanks to the designers of J for these clever ideas. |
Base Point Notation
This notation makes it easy to enter numeric constants in an arbitrary base.
The number to the left of the b is the base of the number system for the characters to the right of the b. The base may be represented in several ways including integers, Exponential, Decimal, Euler, Pi, Gamma, Zeta, Complex, Hypercomplex, Rational, and Variable Precision Floating Point Notation, but not Base Point Notation.
For example, 1E3b111 is the same as 1000b111.
Note that the base may also be negative as in ¯1b0z, fractional as in 0.1b1234, Complex, or Hypercomplex as in 0J1b321.
The characters to the right of the b may range from 0-9 or a-z where the latter range is a way of representing numbers from 10-35 in a single character. The uppercase letters (A-Z) have the same values as the corresponding lowercase case letters and may be used instead of or intermixed with them.
For example, 10bzzZz is the same as 10⊥35 35 35 35, and 1r2b111 is the same as 0.5b111 except for precision — the former is Multiple-Precision and the latter is Fixed.
A decimal point may appear anywhere in the characters to the right of the b to indicate that the characters to its right represent the fractional part of the number in the given base.
Finally, the characters to the right of the b may start with a negative sign (as in 2b¯101 ←→ ¯5) which negates the entire result.
For example, 2b111.111 is (6⍴1)+.×2*2..¯3 which is 7.875.
Euler Point Notation
This notation allows you to enter numeric constants that are in the form of the product of a Multiplier and e (≅ 2.718281828459045... — base of the natural logarithms) raised to an Exponent, that is, M∙eE or M×(*1)*E. The numbers to the left (multiplier) and right (exponent) of the x may be represented in several ways including integers, Decimal, Exponential, Complex, Hypercomplex, Rational, or Variable Precision Floating Point Notation, but not Base, Euler, Pi, Gamma, or Zeta Point Notation.
For example, 1e2x1.1 is the same as 100x1.1, and 1r2x1.1e2 is the same as 0.5x110.
Both the multiplier and exponent may be negative and/or fractional as in ¯1e2x¯3.3.
Pi Point Notation
This notation allows you to enter numeric constants that are in the form of the product of a Multiplier and π (≅ 3.141592653589793... — ratio of a circle's circumference and diameter) raised to an Exponent, that is, M∙πE or M×(○1)*E. The numbers to the left (multiplier) and right (exponent) of the p may be represented in several ways including integers, Decimal, Exponential, Complex, Hypercomplex, Rational, or Variable Precision Floating Point Notation, but not Base, Euler, Pi, Gamma, or Zeta Point Notation.
For example, 1e2p1.1 is the same as 100p1.1, and 1r2p1.1e2 is the same as 0.5p110.
Both the multiplier and exponent may be negative and/or fractional as in ¯1e2p¯3.3.
Gamma Point Notation
This notation allows you to enter numeric constants that are in the form of the product of a Multiplier and γ (≅ 0.5772156649015329... — limiting difference between the harmonic series and the natural logarithm) raised to an Exponent, that is, M∙γE or M×γ*E. The numbers to the left (multiplier) and right (exponent) of the g may be represented in several ways including integers, Decimal, Exponential, Complex, Hypercomplex, Rational, or Variable Precision Floating Point Notation, but not Base, Euler, Pi, Gamma, or Zeta Point Notation.
For example, 1e2g1.1 is the same as 100g1.1, and 1r2g1.1e2 is the same as 0.5g110.
Both the multiplier and exponent may be negative and/or fractional as in ¯1e2g¯3.3.
Zeta Point Notation
This notation allow you to enter numbers that are in the form of the product of a Multiplier and an Argument passed to a call to ζ(x) the Riemann Zeta function, that is, M∙ζ(A). The numbers to the left (multiplier) and right (argument) of the z may be represented in several ways including integers, Decimal, Exponential, Rational, or Variable Precision Floating Point Notation, but not Base, Euler, Pi, Gamma, or Zeta Point Notation. At the moment, although the Zeta function is defined throughout the Complex plane, only the Ball Arithmetic version allows a Complex argument.
For example,
- 1z2 is the constant 1p2÷6 (≅ 1.64493406684822643647241516664602518921...)
- 1z3 is known as Apéry's constant
- 1z2i3± which calculates ζ(2+3i)
Hypercomplex and Complex Angle Point Notation
Hypercomplex Point Notation allows you to enter Complex, Quaternion, and Octonion numbers in various forms as a combination of a Real part followed by one or more Imaginary parts (2nd, 4th, or 8th roots of ¯1) each separated by the corresponding notation. For example,
1i2 | Complex |
1i2j3k4 | Quaternion |
1i2j3k4l5ij6jk7kl8 | Octonion |
For more details, see Hypercomplex Notation in APL.
Complex Angle Point Notation, as in 1.2ad0.25, contains two parts: the Radius 1.2 and the Angle 0.25, which may be expressed in one of four units such as Degrees, Radians, etc., all measured in a counter-clockwise direction from the x-axis, which is 0 in the corresponding unit.
The Angle Domain and Units of the several Complex Angle notations is as follows:
Notation | Angle Domain | Angle Units | ||
ad | [¯360, 360] | Degrees | ||
ar | [¯2p1, 2p1] | Radians | ||
au | [0, 1] | Unit Normalized Radians | ||
ah | [¯0.5, 0.5] | Half Unit Normalized Radians |
Entering a number whose Angle is outside the associated Domain, signals an error.
Ball Arithmetic Point Notation
This notation allows you to enter Ball Arithmetic point values. A Ball consists of a Midpoint and a Radius. The two values are separated by a plus-or-minus sign (±) as in 2.3±1E¯9. If the Radius is zero, it may be omitted.
Ball Arithmetic numbers may also be used as a lefthand part of Base, and any part of Euler, Pi, Gamma, Zeta, Complex, or Hypercomplex Point Notations. For more information, see Ball Arithmetic.
Rational Point Notation
This notation allows you to enter fractions and integers as rational numbers and have them be retained as rational numbers. Rational numbers, using the r infix notation, may be used in the lefthand part of Base, and either part of Euler, Pi, Gamma, or Zeta Point Notations. Rational Integers, using the x suffix notation, may be used in the righthand part of Euler, Pi, Gamma, or Zeta Point Notations only, not in the lefthand part; use r1, as in 123r1g2, instead of 123xg2.
For more information, see Rational Numbers. This notation also accepts strings that contain Decimal and/or Exponential point notation such as 0.3x, 0.7r3, 0.7E¯3r1.7, etc. and represents them as an exact Rational number.
Variable-Precision Floating Point Notation
This notation allows you to enter Decimal and Exponential point values as variable-precision floating point numbers. For example, 2.3v or 2E¯3v.
In this form, the bits of precision of the number is specified by the value of ⎕FPC at the time the number is fixed. Alternatively, the suffix v may be followed by an unsigned integer (≥53) to specify the number of bits of precision of the number, overriding the value of ⎕FPC. For example 2.3v64 is a shorthand for 2.3 as a VFP number with 64 bits of precision.
VFP numbers (using the v suffix) may also be used as a lefthand part of Base, and either part of Euler, Pi, Gamma, or Zeta Point Notations. For more information, see Variable-precision Floating Point (VFP) Numbers.
Exponential Point Notation
This familiar notation (sometimes called scientific notation) allows you to enter numeric constants that are in the form of the product of a multiplier and a (possibly negative) power of 10. Exponential numbers (using either the e or E infix separator) may also be used as a lefthand par of Base, and either part of Euler, Pi, Gamma, Zeta, Complex, Hypercomplex Point Notations.
For example, ¯1.1e2 is the same as ¯110.0, and 1.1E¯6 is the same as 0.0000011.
Decimal Point Notation
This basic notation allows you to enter a decimal value with an integer part and fractional part separated by a period (.) as in 2.3 with an optional leading high minus sign (¯2.3) if the number is negative.
Mixed Notation
The above notations may be combined in a single Point Notation String with the restrictions discussed above, a summary of which follows:
- The right part of Base Point Notation may not contain any of the other Point Notations except for (positive or negative) Decimal.
- The left part of Base Point Notation may contain any of the other Point Notations except itself and Rational Integer Point Notation (e.g., 123x — instead use 123r1).
- Decimal, Exponential, Rational, Variable Precision, Ball, Hypercomplex, and Complex Angle Point Notations may appear in either or both parts of Euler, Pi, Gamma, or Zeta Point Notations, except for Rational Integer Point Notation which may not appear in the lefthand part of epgz notations.
- No two of Euler, Pi, Gamma , or Zeta Point Notations may appear in the same Point Notation String.
For example, 1z2 is calculated in double-precision (53-bit precision) floating point arithmetic, however, if you need more precision, 1z2x is calculated in multiple-precision floating point arithmetic whose precision is set by ⎕FPC.
⎕FPC←128 1z2 1.6449340668482275 1z2x 1.64493406684822643647241516664602518922
In terms of Binding Strength, the Notation with the highest binding strength is Decimal. That is, Decimal Point Notation numbers are constructed first. From highest to lowest binding strength, the sequence is as follows:
- 7. Decimal
- 6. Exponential
- 5. Rational, Variable Precision Floating Point
- 4. Ball Arithmetic
- 3. Hypercomplex, Complex Angle
- 2. Euler, Pi, Gamma, Zeta
- 1. Base
Notations with the same binding strength may not be mixed (e.g., 1r2v is an error). Otherwise, any notation may incorporate notations with a higher binding strength but may not incorporate notations with an equal or lower binding strength.
N.B.: This latter case need not signal an error, but instead might produce a different interpretation. For example,
1r2p1J3 is interpreted as 1r2×(○1x)*1J3 not as 1r2p1+0J3 because Rational and Hypercomplex Point Notations are constructed before Pi Point Notation is.
NARS 2000 Lang Tool Bar |
← | → | + | - | × | ÷ | * | ⍟ | ⌹ | ○ | ! | ? | √ | | | ⌈ | ⌊ | ⊥ | ⊤ | ⊣ | ⊢ | |||
≡ | ≢ | < | ≤ | = | ≥ | > | ≠ | ∨ | ∧ | ⍱ | ⍲ | ↑ | ↓ | ⊂ | ⊃ | ⌷ | ⍋ | ⍒ | |||||
⍳ | ∊ | ⍸ | ⍷ | ∪ | ∩ | ⊆ | ⊇ | ~ | § | π | .. | , | ⍪ | ⍴ | ⌽ | ⊖ | ⍉ | ||||||
/ | \ | ⌿ | ⍀ | ⊙ | ¨ | ⍨ | ⍤ | ⍣ | ⍡ | ⍥ | ⍦ | . | ∘ | ⍠ | ‼ | ⌻ | ∂ | ∫ | ⍞ | ⎕ | ⍎ | ⍕ | |
⋄ | ⍝ | ∇ | ∆ | ⍙ | _ | ⍺ | ⍵ | ¯ | ⍬ | ∞ | ∅ | ||||||||||||
Second Row | i j k | i j k l | g | p | r | v | x |