Fraction Plugin
Fraction Plugin for REALbasic 5.5.5 and later allows you to construct programs which can handle fractions much like doubles and integers are handled. A fraction is represented by two integers, num/den.
As a Mac OS X Universal, Carbon, PPC, and x86 plugin, it can be used to build Mac OS X Universal, Mac OS X Carbon, Mac OS 9.x, or Windows applications.
The operators +, -, *, and / are overloaded. So, for example, these REALbasic statements are valid:
Dim x,y,z As Fraction
x=new Fraction( "-1 1/2")
y=new Fraction("13/3")
z = x+y
EditFieldz.Text = z.Str // shows 2 5/6
And this statement is also valid:
z = 2*x // z will represent -3/1
Version 1.0.1 fixes a bug where z.Str might modify the fraction z.
Version 1.1 renames Fraction Plugin exceptions so as to be compatible with REALbasic 2005.
Version 1.2 adds support for creating Mac OS X Universal applications with REALbasic 2006 Release 4.
Fraction Plugin was programmed in C++ and compiled with CodeWarrior 8.3 and Xcode 2.4.
Freeware.
Download Fraction Plugin v 1.2. The download includes documentation and a sample project.
FractionPlugin.zip (228 KB)