Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
6. Jan 2023
so many thanks for all your great help ,
What about this please :
internal static IObject ReadObject(uint constructorNb = 0)
{
var myDef = type.GetCustomAttribute<MYDefAttribute>();
var obj = Activator.CreateInstance(type, true);
IEnumerable<FieldInfo> fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public);
if (myDef.inheritBefore) fields = fields.GroupBy(f =>...
Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
1. Jan 2023
So many thanks for all your great help end valuable time .
:wink: i still need your help to port this code :
internal static void PrintValue(object value, Type valueType)
{
if (value == null)
{
Console.WriteLine(valueType);
return;
}
Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
23. Dez 2022
Can this great delphi implementation help :
http://rvelthuis.de/programs/bigintegers.html
Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
22. Dez 2022
So many thanks , and what about this please :
public static bool IsProbablePrime(this BigInteger n)
{
var n_minus_one = n - BigInteger.One;
if (n_minus_one.Sign <= 0) return false;
int s;
var d = n_minus_one;
for (s = 0; d.IsEven; s++) d >>= 1;
Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
22. Dez 2022
so many thanks for such a great effort .
Forum: Object-Pascal / Delphi-Language
Delphi
by sdean,
22. Dez 2022
Hello can someone help me porting this C# code into Delphi :
internal static ulong PQFactorize(ulong pq)
{
if (pq < 2) return 1;
var random = new Random();
ulong g = 0;
for (int i = 0, iter = 0; i < 3 || iter < 1000; i++)
{
ulong q = (ulong)random.Next(17, 32) % (pq - 1);