Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Latest commit

 

History

History

Docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/
 *
 * Copyright (C) 2013-2014, Peter Johnson (www.delphidabbler.com).
 *
 * Read-me file for Fractions unit
-->
<html lang="en">

<head>

  <meta charset="UTF-8" />

  <title>
    DelphiDabbler Fractions Unit ReadMe
  </title>

  <style type="text/css">
    body {
      margin: 1em;
      padding: 0;
      font-family: Verdana, Arial, sans-serif;
      font-size: 9pt;
      line-height: 150%;
    }
    h1 {
      margin: 0 0 1em 0;
      padding: 0.5em;
      border: 1px silver solid;
      background-color: #eee;
      font-size: 13pt;
      font-weight: bold;
      text-align: center;
    }
    h1 .subtitle {
      font-style: italic;
      color: #336;
    }
    h2 {
      margin: 1em 0 0 0;
      padding: 0;
      padding-bottom: 6px;
      border-bottom: 1px silver solid;
      font-size: 11pt;
      font-weight: bold;
    }
    h3 {
      margin: 0.5em 0 0 0;
      padding: 0;
      font-size: 9pt;
      font-weight: bold;
    }
    p {
      margin: 0.5em 0 0 0;
      padding: 0;
    }
    ul, ol {
      margin: 0.5em 0 0 3em;
      padding: 0;
    }
    ul {
      list-style-type: square;
    }
    ul.spaced li,
    ol.spaced li {
      margin-top: 0.5em;
    }
    ul.spaced li,
    ol.spaced li {
      margin-top: 0.5em;
    }
    ul.unspaced li,
    ol.unspaced li {
      margin-top: 0;
    }
    ul.unspaced li.first,
    ol.unspaced li.first {
      margin-top: 0.5em;
    }
    code {
      font-family: "Courier New", Courier, monospace;
    }
    a:link {
      color: #336;
      text-decoration: underline;
    }
    a:visited {
      color: #669;
      text-decoration: underline;
    }
    a:active {
      color: #336;
      text-decoration: underline;
    }
    a:hover {
      text-decoration: underline;
    }
    .pullout {
      border-left: 8px silver solid;
      background-color: #eee;
      margin: 0.5em 0 0 0;
      padding: 0.25em 0.5em;
      font-style: italic;
    }
    .indent {
      margin-left: 3em;
    }
    .highlight {
      color: #336;
      font-style: italic;
      font-weight: bold;
    }
    .endnotes {
      margin: 1.5em 0 0 0;
      padding: 1em 0 0 0;
      border-top: 1px silver solid;
    }
    .comments {
      font-style: italic;
    }
    .copyright,
    .copyright a:link,
    .copyright a:visited,
    .copyright a:active {
      margin: 1em 0 0 0;
      color: gray;
      font-size: 8pt;
      text-align: right;
    }
    .smallcaps {
      font-variant: small-caps;
    }
  </style>

</head>

<body>


<h1>
  Fractions Unit<br />
  <span class="subtitle">ReadMe</span>
</h1>


<h2 id="description">
  Description
</h2>

<p>
  The <code>DelphiDabbler.Lib.Fractions.pas</code> unit provides a single
  &quot;Advanced;&quot; record, <var>TFraction</var> that encapsulates a
  fraction and a number of operations on it.
</p>

<p>
  A whole bunch of operator overloads make it straightforward to perform all the
  usual arithmetic operations on a fraction and to cast a <var>TFraction</var>
  to a from an integer or floating point value.
</p>

<p>
  For full details of methods and operator overloads see the comprehensive <a
    href="http://www.delphidabbler.com/url/fractions-docs"
  >online documentation</a>. There is no help file.
</p>

<p>
  <em>DUnit</em> tests for <var>TFraction</var> are included in the download.
</p>


<h2 id="compatibility">
  Compatibility
</h2>

<p>
  This unit requires Delphi 2009 as a minimum and has been tested on all
  32 bit Windows compilers from Delphi 2009 to Delphi XE4 and 64 bit Windows
  compilers from Delphi XE2 to XE4.
</p>


<h2 id="installation">
  Installation
</h2>

<p>
  The Fractions Unit, documentation and test suite are supplied in a zip file.
  Before installing you need to extract all the files from the zip file,
  preserving the directory structure. The following files will be extracted:
</p>

<ul>
  <li>
    <code><strong>DelphiDabbler.Lib.Fractions.pas</strong></code> &ndash; Main
    source code.
  </li>
  <li>
    <code>ReadMe.htm</code> &ndash; The unit's read-me file.
  </li>
  <li>
    <code>MPL-2.txt</code> &ndash; Mozilla Public License v2.0.
  </li>
  <li>
    <code>ChangeLog.txt</code> &ndash; The project's change log.
  </li>
  <li>
    <code>Documentation.URL</code> &ndash; Short-cut to the online
    documentation.
  </li>
</ul>

<p>
  In addition to the above files you will find the <em>DUnit</em> tests in the
  <code>Test</code> sub-directory.
</p>

<p>
  There are three possible ways to use the unit.
</p>

<ol class="spaced">
  <li>
    The simplest way is to add <code>DelphiDabbler.Lib.Fractions.pas</code> to
    your projects as you need it.
  </li>
  <li>
    To make the unit easier to re-use you can either copy it to a folder on your
    Delphi search path, or add the folder containing the unit to the Delphi
    Search path. You then simply use the unit as required without needing to add
    it to your project.
  </li>
  <li>
    For maximum portability you can add the unit to a Delphi package. If you
    need help doing this <a
      href="http://www.delphidabbler.com/url/install-comp"
    >see here</a>.
  </li>
</ol>


<h2 id="update">
  Update History
</h2>

<p>
   A complete change log is provided in the file <code>ChangeLog.txt</code>.
</p>


<h2 id="license">
  License
</h2>

<p>
  The <em>Fractions Unit</em> (<code>DelphiDabbler.Lib.Fractions.pas</code>) is
  released under the terms of the <a
    href="http://www.mozilla.org/MPL/2.0/"
  >Mozilla Public License v2.0</a>.
</p>

<p>
  All relevant trademarks are acknowledged.
</p>


<h2>
  Acknowledgements
</h2>

<ul class="spaced">
  <li>
    The information on fractions in the Mathematics Help Facility at <a
      href="http://www.themathleague.com/"
    >http://www.themathleague.com/</a> was useful in writing this code.
  </li>
  <li>
    The <var>GCD</var> and <var>LCM</var> routines were taken from a <a
      href="http://www.efg2.com/Lab/Library/UseNet/2000/0315b.txt"
    >UseNet post</a> by Hans van Kruijssen.
  </li>
  <li>
    The <var>DecimalToFraction</var> routine was adapted from the Turbo Pascal
    code presented in &quot;<a
      href="http://homepage.smc.edu/kennedy_john/DEC2FRAC.PDF"
    >Algorithm To Convert A Decimal To A Fraction</a>&quot; by John Kennedy,
    Mathematics Department, Santa Monica College.
  </li>
</ul>


<h2 id="bugs">
  Bugs and Feature Requests
</h2>

<p>
  Bugs can be reported or new features requested via the <a
    href="http://www.delphidabbler.com/url/ddlib-issues"
  >Issue Tracker</a>.
</p>

<p>
  If no similar report or request has been recorded already, use the <em>New
  Issue</em> link to add a new issue. Please select the most appropriate
  template from the <em>Templates</em> drop down list and change the
  <code>Project-unspecified</code> label to <code>Project-fractions</code>.
</p>


<h2 id="author">
  About the Author
</h2>

<p>
  I'm Peter Johnson &ndash; a hobbyist programmer living in Ceredigion in West
  Wales, UK, writing write mainly in Delphi. My programs and code are available
  from: <a
    href="http://delphidabbler.com/"
  >http://www.delphidabbler.com/</a>.
</p>

<p>
  I can be <a
    href="http://delphidabbler.com/contact"
  >contacted via the website</a>.
</p>


<div class="endnotes">
  <div class="comments">
    Please do <a
      href="http://delphidabbler.com/contact"
    >let me know</a> if you have any comments about the unit, but please use the
    Issue Tracker above to report bugs and request new features.
  </div>
  <div class="copyright">
    This document is copyright &copy; 2013-2014, P D Johnson, <a
      href="http://delphidabbler.com/"
    >delphidabbler.com</a>.
  </div>
</div>

</body>

</html>