AngouriMath

Navigation

← Back to list of members

CreateRational​(PeterO.​Numbers.​EInteger,​PeterO.​Numbers.​EInteger)

 Method (no overloads)

Summary

Creates an instance of Rational from two EIntegers

Parameter "numerator"

Numerator of type EInteger

Parameter "denominator"

Denominator of type EInteger

Returns

The resulting Rational

Example

using System;
using System.Numerics;
using AngouriMath;
using PeterO.Numbers;
using static AngouriMath.MathS.Numbers;
using static AngouriMath.MathS;

Entity a1 = 5;
Entity a2 = "5";
Entity a3 = new Complex(5.5, 6.5);
Entity a4 = 6.5m;
Entity a5 = 6.5;
Entity a6 = 6.5f;
Entity a7 = 5.6 + 3 * i;
Entity a8 = EInteger.One;
Entity a9 = ERational.One;
Entity a10 = pi;
Console.WriteLine("---------------");
var n0 = Create(0);
var n1 = Create(0L);
var n2 = Create(new Complex(5.5, 4.75));
var n3 = Create(EInteger.One);
var n4 = CreateRational(4, 5);
var n5 = Create(ERational.One);
var n6 = Create(5.5m);
var n7 = Create(5.5);
var n8 = Create(5.5m, 6.5m);
Console.WriteLine("---------------");
float i0 = (float)FromString("1 + 5").EvalNumerical();
double i1 = (double)FromString("1 + 5").EvalNumerical();
int i2 = (int)FromString("1 + 5").EvalNumerical();
long i3 = (long)FromString("1 + 5").EvalNumerical();
short i4 = (short)FromString("1 + 5").EvalNumerical();
BigInteger i5 = (BigInteger)FromString("1 + 5").EvalNumerical();
Complex i6 = (Complex)FromString("1 + 5").EvalNumerical();
EInteger i7 = ((Entity.Number.Integer)FromString("1 + 5").EvalNumerical()).EInteger;
ERational i8 = ((Entity.Number.Rational)FromString("1 + 5").EvalNumerical()).ERational;
EDecimal i9 = ((Entity.Number.Real)FromString("1 + 5").EvalNumerical()).EDecimal;

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online