Imports Problems.libgmpWrapper ''' Expected results: ''' Left: 2 Right: 3 ''' Left: 1461501637330902918203684832716283019655932542976 Right: 1853020188851841 Module Testmodul Sub Main() Dim left As mpz_struct Dim right As mpz_struct ' First, intialize all GMP values! mpz_init(left) mpz_init(right) ' Fill left with 2 left = 2 ' Fill right with 3 with internal GMP function mpz_set_ui(right, 3) ' Show current values in both ways. ' In most cases, the .ToString is optional, but don't trust the concatenate (&) from VB.NET too much! Console.WriteLine("Left: " & left.ToString & " Right: " & mpz_get_str("", 10, right)) ' Some mathematical operations left *= 16 right = right ^ left left = left Mod 1000 left = left ^ left Console.WriteLine("Left: " & left.ToString & " Right: " & mpz_get_str("", 10, right)) ' Problematic equations: ' left = 16 ^ 2 ' This won't work "cleanly", als 16^2 will result in a double, which can't be assigned to mpz. ' left = left ^ 2 - left ^ 1 ' This will result in an application crash. End Sub End Module