Skip to content

Commit c268150

Browse files
committed
Merge branch 'release/0.1.2-beta' into main
2 parents bfb65cf + 23f7b41 commit c268150

File tree

8 files changed

+537
-373
lines changed

8 files changed

+537
-373
lines changed

.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# .gitignore file based on
2+
# https://github.com/github/gitignore/blob/main/Delphi.gitignore
3+
# License: CC0
4+
5+
# ----------------------------------
6+
# Delphi compiler-generated binaries
7+
# ----------------------------------
8+
9+
*.exe
10+
*.dll
11+
*.bpl
12+
*.bpi
13+
*.dcp
14+
*.so
15+
*.apk
16+
*.drc
17+
*.map
18+
*.dres
19+
*.rsm
20+
*.tds
21+
*.dcu
22+
*.lib
23+
*.a
24+
*.o
25+
*.ocx
26+
#*.res
27+
*.tlb
28+
*.obj
29+
30+
# --------------------------------------------
31+
# Delphi autogenerated files (duplicated info)
32+
# --------------------------------------------
33+
34+
*.cfg
35+
*.hpp
36+
#Resource.rc
37+
38+
# ----------------------------------------------
39+
# Delphi designer / tools files (not being used)
40+
# ----------------------------------------------
41+
42+
# diagram portfolio file
43+
*.dpp
44+
45+
# visual live bindings
46+
*.vlb
47+
48+
# deployment manager
49+
*.deployproj
50+
51+
# ---------------------------------------
52+
# Delphi local files (user-specific info)
53+
# ---------------------------------------
54+
55+
*.local
56+
*.identcache
57+
*.projdata
58+
*.tvsconfig
59+
*.dsk
60+
61+
# --------------------------
62+
# Delphi history and backups
63+
# --------------------------
64+
65+
__history/
66+
__recovery/
67+
*.~*
68+
69+
# ----------------
70+
# Project specific
71+
# ----------------
72+
73+
dunit.ini
74+

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Change Log for Fractions unit
2+
3+
## v0.1.2 beta of 13 December 2023
4+
5+
+ Revised _LCM_ routine to reduce chance of integer overflow [issue #8].
6+
+ Added `.gitignore` file.
7+
+ Documentation changes:
8+
+ Moved `Docs/ChangeLog.txt`into repo root, converted from plain text to Markdown format and renamed as `CHANGELOG.md`.
9+
+ Moved `Docs/ReadMe.htm` file into repo root, converted from HTML to Markdown format, revised and renamed as `README.md`.
10+
+ Removed broken links from header comments in Pascal unit.
11+
12+
## v0.1.1 beta of 11 January 2014
13+
14+
+ Fixed problem with compiler directives in Fractions unit that was causing compilation to fail on Delphi XE5.
15+
+ Minor documentation tweaks and corrections.
16+
17+
## v0.1.0 beta of 13 January 2013
18+
19+
+ Initial beta release for Delphi 2009 and later.

DelphiDabbler.Lib.Fractions.pas

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
44
* obtain one at http://mozilla.org/MPL/2.0/
55
*
6-
* Copyright (C) 2013-2014, Peter Johnson (www.delphidabbler.com).
6+
* Copyright (C) 2013-2023, Peter Johnson (www.delphidabbler.com).
77
*
88
* Defines an advanced record type that encapsulates fraction and related
99
* operations.
1010
*
1111
* Acknowledgements:
1212
* o The information on fractions in the Mathematics Help Facility at
13-
* http://www.themathleague.com/ was useful in writing this code.
13+
* https://mathleague.com/ was useful in writing this code.
1414
* o The GCD and LCM routines were taken from a UseNet post by Hans van
15-
* Kruijssen: see http://www.efg2.com/Lab/Library/UseNet/2000/0315b.txt.
15+
* Kruijssen [link broken].
1616
* o The DecimalToFraction routine was adapted from the Turbo Pascal code
1717
* presented in "Algorithm To Convert A Decimal To A Fraction" by John
18-
* Kennedy, Mathematics Department, Santa Monica College. See
19-
* http://homepage.smc.edu/kennedy_john/DEC2FRAC.PDF
18+
* Kennedy, Mathematics Department, Santa Monica College.
19+
* o lukas-hribik (https://github.com/lukas-hribik) for suggesting a reworking
20+
* of the LCM function to reduce the chance of integer overflow.
2021
}
2122

2223

@@ -313,7 +314,7 @@ function GCD(A, B: Int64): Int64;
313314
/// <summary>Calculates the least common multiple of two integers.</summary>
314315
function LCM(A, B: Int64): Int64;
315316
begin
316-
Result := (A * B) div GCD(A, B);
317+
Result := A * (B div GCD(A, B));
317318
end;
318319

319320
/// <summary>Converts a decimal to a fraction.</summary>

Docs/ChangeLog.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

Docs/Documentation.URL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[InternetShortcut]
2-
URL=http://www.delphidabbler.com/url/fractions-docs
2+
URL=https://delphidabbler.com/url/fractions-docs

0 commit comments

Comments
 (0)