You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2021/06/10 14:15:25 UTC

[commons-math] 01/05: MATH-1603: Userguide update.

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit dd135e568beb32928884f59e7d264d6f00a2cd8b
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Thu Jun 10 15:41:09 2021 +0200

    MATH-1603: Userguide update.
---
 src/site/xdoc/userguide/fraction.xml | 78 +-----------------------------------
 src/site/xdoc/userguide/index.xml    |  2 -
 2 files changed, 2 insertions(+), 78 deletions(-)

diff --git a/src/site/xdoc/userguide/fraction.xml b/src/site/xdoc/userguide/fraction.xml
index 3f8ae51..6133cc4 100644
--- a/src/site/xdoc/userguide/fraction.xml
+++ b/src/site/xdoc/userguide/fraction.xml
@@ -26,82 +26,8 @@
     <section name="9 Fractions">
       <subsection name="9.1 Overview" href="overview">
         <p>
-          The fraction packages provides a fraction number type as well as
-          fraction number formatting.
-        </p>
-      </subsection>
-      <subsection name="9.2 Fraction Numbers" href="fraction">
-        <p>
-          <a href="../apidocs/org/apache/commons/math4/fraction/Fraction.html">
-          Fraction</a> and <a href="../apidocs/org/apache/commons/math4/fraction/BigFraction.html">
-          BigFraction</a> provide fraction number type that forms the basis for
-          the fraction functionality found in Commons-Math. The former one can be
-          used for fractions whose numerators and denominators are small enough
-          to fit in an int (taking care of intermediate values) while the second
-          class should be used when there is a risk the numerator and denominator
-          grow very large.
-        </p>
-        <p>
-          A fraction number, can be built from two integer arguments representing numerator
-          and denominator or from a double which will be approximated:
-          <source>Fraction f = new Fraction(1, 3); // 1 / 3
-Fraction g = new Fraction(0.25); // 1 / 4</source>
-        </p>
-        <p>
-          Of special note with fraction construction, when a fraction is created it is always reduced to lowest terms.
-        </p>
-        <p>
-          The <code>Fraction</code> class provides many unary and binary
-          fraction operations.  These operations provide the means to add,
-          subtract, multiple and, divide fractions along with other functions similar to the real number functions found in
-          <code>java.math.BigDecimal</code>:
-          <source>Fraction lhs = new Fraction(1, 3);
-Fraction rhs = new Fraction(2, 5);
-
-Fraction answer = lhs.add(rhs);     // add two fractions
-        answer = lhs.subtract(rhs); // subtract two fractions
-        answer = lhs.abs();         // absolute value
-        answer = lhs.reciprocal();  // reciprocal of lhs</source>
-        </p>
-        <p>
-          Like fraction construction, for each of the fraction functions, the resulting fraction is reduced to lowest terms.
-        </p>
-      </subsection>
-      <subsection name="9.3 Fraction Formatting and Parsing" href="formatting">
-        <p>
-          <code>Fraction</code> instances can be converted to and from strings
-          using the<a href="../apidocs/org/apache/commons/math4/fraction/FractionFormat.html">
-          FractionFormat</a> class. <code>FractionFormat</code> is a
-          <code>java.text.Format</code> extension and, as such, is used like other
-          formatting objects (e.g. <code>java.text.SimpleDateFormat</code>):
-          <source>FractionFormat format = new FractionFormat(); // default format
-Fraction f = new Fraction(2, 4);
-String s = format.format(f); // s contains "1 / 2", note the reduced fraction</source>
-        </p>
-        <p>
-          To customize the formatting output, one or two
-          <code>java.text.NumberFormat</code> instances can be used to construct
-          a <code>FractionFormat</code>.  These number formats control the
-          formatting of the numerator and denominator of the fraction:
-          <source>NumberFormat nf = NumberFormat.getInstance(Locale.FRANCE);
-// create fraction format with custom number format
-// when one number format is used, both numerator and
-// denominator are formatted the same
-FractionFormat format = new FractionFormat(nf);
-Fraction f = new Fraction(2000, 3333);
-String s = format.format(c); // s contains "2.000 / 3.333"
-
-NumberFormat nf2 = NumberFormat.getInstance(Locale.US);
-// create fraction format with custom number formats
-format = new FractionFormat(nf, nf2);
-s = format.format(f); // s contains "2.000 / 3,333"</source>
-        </p>
-        <p>
-          Formatting's inverse operation, parsing, can also be performed by
-          <code>FractionFormat</code>.  To parse a fraction from a string,
-          simply call the <code>parse</code> method:
-          <source>FractionFormat ff = new FractionFormat();
-Fraction f = ff.parse("-10 / 21");</source>
+          The concept of "fraction" is implemented in
+          <a href="http://commons.apache.org/numbers">Commons Numbers</a>.
         </p>
       </subsection>
     </section>
diff --git a/src/site/xdoc/userguide/index.xml b/src/site/xdoc/userguide/index.xml
index 992efdc..458e5e4 100644
--- a/src/site/xdoc/userguide/index.xml
+++ b/src/site/xdoc/userguide/index.xml
@@ -104,8 +104,6 @@
         <li><a href="fraction.html">9. Fractions</a>
                 <ul>
                 <li><a href="fraction.html#a9.1_Overview">9.1 Overview</a></li>
-                <li><a href="fraction.html#a9.2_Fraction_Numbers">9.2 Fraction Numbers</a></li>
-                <li><a href="fraction.html#a9.3_Fraction_Formatting_and_Parsing">9.3 Fraction Formatting and Parsing</a></li>
                 </ul></li>                                 
         <li><a href="transform.html">10. Transform methods</a></li>                                 
         <li><a href="geometry.html">11. Geometry</a>