wezeku / mpir.net Goto Github PK
View Code? Open in Web Editor NEWMPIR for .NET
Home Page: http://wezeku.github.io/Mpir.NET/
License: GNU Lesser General Public License v3.0
MPIR for .NET
Home Page: http://wezeku.github.io/Mpir.NET/
License: GNU Lesser General Public License v3.0
Hi,
Please would you consider adding Min , Max and Abs functions
Hello,
The following source code returns the incorrect result. Instead of value 5 it show 6.
Platform target: x64
static void Main(string[] args)
{
mpz_t a = new mpz_t(3);
mpz_t b = new mpz_t(7);
mpz_t c;
c = a.PowerMod(-1, b);
System.Console.WriteLine("{0}", c);
}
If I give mpz_t a negative long in the constructor, I get a positive mpz_t.
For now, using int instead has been fine.
Repro is quite simple:
var val = new mpz_t((long)-1);
Inspecting in the debugger gives: {18446744073709551615}
Thanks for your great work!
Does MPIR.net support .Net core? thank you
Hi,
your project is great. Do you plain support mono or PCL?
will mpf_t be available?
btw: wich generator do you use for generating the native mappings?
The mpf_t
class isn't complete.
Hi,
this code
mpz_t a1 = 0;
mpz_t a2 = 0;
mpir.mpz_add(a2, a2, 2);
Console.WriteLine(a1);
will write 2 instead of 0, because in implicit cast method you return reference to static mpz_t.Zero in both case. (i think you want to return .clone() or maybe it will be better to return new mpz_t(val))
I was informed that mpq is not supported, but it seems however that there are a number of supporting functions for mpq, and the mpq_t class does exist. A few functions are missing though, e.g. mpq_numref and mpq_denref.
I tried adding them the same way as the other functions, but it didn't seem to work.
If these functions are to return mpz_t, I suspect the mpz_t needs an additional field, e.g. IsPartOfMpq, that, if true, should indicate to mpz_t.Dispose()/destructor if it should indeed dispose internally or not, or let the mpq_t.Dispose()/destructor handle it, to avoid memory corruption by the GC. mpq_t would also need hold a reference to it's mpz_t (class) numref and denref so as to return the same instance, if they were ever instantiated.
In Mpir.NET 0.4.0 there is a bug in the above function. It returns both right and wrong results. I couldn't fix it yet.
please see
wbhart/mpir#180
for details and test cases.
It would really help if you could provide this Constructor overload
Public Sub New(bytes() As Byte, order As Integer,offset as Integer, length as Integer)
IT would be useful for working with byte array segments.
After installing and starting my project, I get this exception:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Mpir.NET.mpir' threw an exception.
Source=Mpir.NET
StackTrace:
at Mpir.NET.mpir.mpz_init_set_si(Int32 op)
at Mpir.NET.mpz_t..ctor(Int32 op)
at Mpir.NET.mpz_t.op_Implicit(Int32 value)
at PiDemo.Program.d__0.MoveNext() in C:\Users<user>\source\repos\PiDemo\Program.cs:line 13
at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable
1 collection)
at System.Collections.Generic.List1.AddRange(IEnumerable
1 collection)
at PiDemo.Program.Main(String[] args) in C:\Users<user>\source\repos\PiDemo\Program.cs:line 58
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
Exception: MPIR: can't determine path to the xmpir64.dll
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.