+ 3

C# BigInteger not found

I was hoping to use the BigInteger type in some code, however the BigInteger namespace could not be found, despite me using the correct System.Numerics namespace. If this is a question of the compiler being outdated, I hope in the future it could be updated. I know that there have been other posts but other value types are too small for what I am attempting to implement. Thanks for any help!

31st Dec 2019, 5:19 PM
Gabriel Altwarg-Peel
Gabriel Altwarg-Peel - avatar
5 Respostas
+ 3
I just spent some time looking through the Playground file system and could not locate the System.Numerics.dll assembly file. If that file can be located, then it could be loaded via the Reflection API. But, I'm thinking it's a no go here.
1st Jan 2020, 6:30 AM
David Carroll
David Carroll - avatar
+ 2
I'm attempting to generate 1000 digits of pi and for that I was converting the output from each iteration into an integer so that I could calculate a bigger decimal expansion for pi.
1st Jan 2020, 10:28 AM
Gabriel Altwarg-Peel
Gabriel Altwarg-Peel - avatar
+ 1
Are you sure it cannot be changed on any such way?
31st Dec 2019, 11:02 PM
Gabriel Altwarg-Peel
Gabriel Altwarg-Peel - avatar
+ 1
Well I am not sure because I am not a C# expert. But I haven't found any other solution online, except adding the assembly reference in Visual Studio, or adding some extra options when compiling the program. Maybe an alternative could be the Decimal type that can store up to 29 digits. What exactly is the problem you are trying to solve, that requires so big numbers? https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types
1st Jan 2020, 6:06 AM
Tibor Santa
Tibor Santa - avatar
- 1
It seems to me that the namespace is available, because this doesn't throw an error : using System.Numerics; But then, if you want to instantiate a BigInteger there is an error like this: https://github.com/mono/mono/issues/11773 My guess is that the code would have to be compiled in a special way, with assembly reference, and we cannot do this on SoloLearn. This is not really the compiler's fault but we cannot make these project level settings on the code playground.
31st Dec 2019, 10:16 PM
Tibor Santa
Tibor Santa - avatar