It is implemented over BigInteger. Minimum .Net Framework version is 4.0.
- Automatically simplifies the fraction.
- Fraction can be represented in form of Mixed Fraction.
- Supports undefined values (Undefined,+Infinity,-Infinity).
- Data type BigInteger is used and can store all possible rational numbers.
- String-Fraction conversion (ToString() or TryParse()).
- Supports comparisons, conversions and operations.
- Use
Approces()
function orLike
operator to check if two numbers are similar. e.g(3.14 Like 22/7) == true
- Open source.
- Reducing fraction
- Convertion from Float/Double/Decimal to Fraction
Fraction f1 = "0.5"; //1/2
Fraction f2 = "1.2/0.6"; //2/1
Fraction f3 = f1 + f2; //5/2
Fraction f4 = f1 * f2; //1/1
Fraction f5 = f1.Square; //1/4
Fraction pi1 = "3.14"; //157/50
Fraction pi2 = "22/7"; //22/7
bool b = pi1.Approches(pi2); //true