Open BCSharp opened 2 years ago
As I understand it, Mono's API surface supports .NET Standard 2.1 (since 6.4 according to the .NET Standard page) which means it makes sense that these APIs appear on BigInteger. Although how one would go about creating an assembly that makes use these APIs (without going through reflection) I have no idea.
In any case, as I noted in the related PR I don't have any good proposals at the moment. It would probably have to be something that's reflection based...
Python type
int
is backed byBigInteger
, but bothBigInteger
andInt32
instances are used asint
instances for performance reasons (#52). For the Python type system consistency, any attributes available onint
(thusBigInteger
) should be available on instances ofint
(thus also onInt32
instances). PR #1399 implemented a set of properties and methods that are available onBigInteger
but not onInt32
as additional extension methods forInt32
. However, this does not work well on Mono (v6.12.0.162 on darwin, but possibly on linux too). The following methods appear onint
that do not appear onInt32
instances:GetByteCount
TryWriteBytes
These two methods do not exist in .NET Framework 4.6 so they should not exist in Mono as well. And indeed, they do not, at least not as members of
System.Numerics.BigInteger
(so they are not accessible in C# code). However, somehow they do appear in IronPython, perhaps they are implemented as extensions?