~ubuntu-branches/ubuntu/maverick/commons-math/maverick

« back to all changes in this revision

Viewing changes to src/site/xdoc/userguide/fraction.xml

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-08-22 01:13:25 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090822011325-hi4peq1ua5weguwn
Tags: 2.0-1
* New upstream release.
* Set Maintainer field to Debian Java Team
* Add myself as Uploaders
* Switch to Quilt patch system:
  - Refresh all patchs
  - Remove B-D on dpatch, Add B-D on quilt
  - Include patchsys-quilt.mk in debian/rules
* Bump Standards-Version to 3.8.3:
  - Add a README.source to describe patch system
* Maven POMs:
  - Add a Build-Depends-Indep dependency on maven-repo-helper
  - Use mh_installpom and mh_installjar to install the POM and the jar to the
    Maven repository
* Use default-jdk/jre:
  - Depends on java5-runtime-headless
  - Build-Depends on default-jdk
  - Use /usr/lib/jvm/default-java as JAVA_HOME
* Move api documentation to /usr/share/doc/libcommons-math-java/api
* Build-Depends on junit4 instead of junit

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
  -->
19
19
  
20
20
<?xml-stylesheet type="text/xsl" href="./xdoc.xsl"?>
21
 
<!-- $Revision: 619641 $ $Date: 2008-02-07 14:17:35 -0700 (Thu, 07 Feb 2008) $ -->
 
21
<!-- $Revision: 759543 $ $Date: 2009-03-28 14:24:11 -0400 (Sat, 28 Mar 2009) $ -->
22
22
<document url="stat.html">
23
23
  <properties>
24
24
    <title>The Commons Math User Guide - Fractions</title>
34
34
      <subsection name="9.2 Fraction Numbers" href="fraction">
35
35
        <p>
36
36
          <a href="../apidocs/org/apache/commons/math/fraction/Fraction.html">
37
 
          org.apache.commons.math.fraction.Fraction</a> provides a fraction number
 
37
          org.apache.commons.math.fraction.Fraction</a> and
 
38
          <a href="../apidocs/org/apache/commons/math/fraction/BigFraction.html">
 
39
          org.apache.commons.math.fraction.BigFraction</a> provide fraction number
38
40
          type that forms the basis for the fraction functionality found in 
39
 
          commons-math.
 
41
          commons-math. The former one can be used for fractions whose numerators
 
42
          and denominators are small enough to fit in an int (taking care of intermediate
 
43
          values) while the second class should be used when there is a risk the numerator
 
44
          and denominator grow very large.
40
45
        </p>
41
46
        <p>
42
 
          To create a fraction number, simply call the constructor passing in two
43
 
          integer arguments, the first being the numerator of the fraction and the second being the denominator:
44
 
          <source>Fraction f = new Fraction(1, 3); // 1 / 3</source>
 
47
          A fraction number, can be built from two integer arguments representing numerator
 
48
          and denominator or from a double which will be approximated:
 
49
          <source>Fraction f = new Fraction(1, 3); // 1 / 3
 
50
Fraction g = new Fraction(0.25); // 1 / 4</source>
45
51
        </p>
46
52
        <p>
47
53
          Of special note with fraction construction, when a fraction is created it is always reduced to lowest terms.