Ich versuche, eine Open-Source-Bibliothek von .Net 4,0-3,5 zu konvertieren und kann den folgenden langen Multiplikation Code nicht leicht umwandeln:Computing die hohe Bits einer Multiplikation in C#
/// <summary>
/// Calculate the most significant 64 bits of the 128-bit
product x * y, where x and y are 64-bit integers.
/// </summary>
/// <returns>Returns the most significant 64 bits of the product x * y.</returns>
public static long mul64hi(long x, long y)
{
#if !NET35
BigInteger product = BigInteger.Multiply(x, y);
product = product >> 64;
long l = (long)product;
return l;
#else
throw new NotSupportedException(); //TODO!
#endif
}
Wie Sie das sehen Autor hat keinen Weg gefunden, dies zu tun. BigInteger
ist in .NET 3.5 nicht vorhanden.
Wie kann ich die hohen Bits 64 Bits einer 64 * 64 Multiplikation auf .NET 3.5 berechnen?
https://msdn.microsoft.com/en-us/magazine/cc163696.aspx –
Danke für den Link, mit der J # -Bibliothek, könnte ich das zum Funktionieren bringen! Ich probiere es jetzt aus ... – Seneral
hm nein funktioniert nicht für mich, [MDSN] (https://msdn.microsoft.com/de-de/library/7xsxf8e2%28v=vs.90%29.aspx) sagt, es ist nur verfügbar in VS 5 oder weniger, und ich muss VS2010 für die anderen Probleme verwenden (Standardparameter) – Seneral