b85239
--- src/integer.c.orig	2019-02-23 15:43:33.000000000 -0700
b85239
+++ src/integer.c	2019-03-12 13:39:47.357775303 -0600
b85239
@@ -567,6 +567,41 @@ Obj ObjInt_UInt8( UInt8 i )
3ed98e
 #endif
e0c897
 }
e0c897
 
e0c897
+Obj ObjInt_LongLong( long long i )
e0c897
+{
e0c897
+  Obj gmp;
e0c897
+  unsigned long long ull;
e0c897
+  size_t j;
e0c897
+
e0c897
+  if ( (-(1LL<<nr_small_int_bits) <="i)" &&="" (i="" <="" 1ll<<nr_small_int_bits="" ))<="" code="">
e0c897
+    return INTOBJ_INT((Int) i);
e0c897
+
e0c897
+  if ( i >= 0LL ) {
e0c897
+    gmp = NewBag( T_INTPOS, sizeof(i) );
e0c897
+    ull = (unsigned long long) i;
e0c897
+  }
e0c897
+  else {
e0c897
+    gmp = NewBag( T_INTNEG, sizeof(i) );
e0c897
+    ull = (unsigned long long) -i;
e0c897
+  }
3ed98e
+  for ( j = 0U; j < sizeof(i) / sizeof(mp_limb_t); j++ )
3ed98e
+    ((mp_limb_t *)ADDR_OBJ( gmp ))[j] = ull >> (j * sizeof(mp_limb_t));
e0c897
+  return GMP_NORMALIZE( gmp );
e0c897
+}
e0c897
+
e0c897
+Obj ObjInt_ULongLong( unsigned long long i )
e0c897
+{
e0c897
+  Obj gmp;
e0c897
+  size_t j;
e0c897
+
e0c897
+  if ( i < 1ULL<<nr_small_int_bits )<="" code="">
e0c897
+    return INTOBJ_INT((Int) i);
e0c897
+  gmp = NewBag( T_INTPOS, sizeof(i) );
3ed98e
+  for ( j = 0U; j < sizeof(i) / sizeof(mp_limb_t); j++ )
3ed98e
+    ((mp_limb_t *)ADDR_OBJ( gmp ))[j] = i >> (j * sizeof(mp_limb_t));
e0c897
+  return GMP_NORMALIZE( gmp );
e0c897
+}
e0c897
+
3ed98e
 /**************************************************************************
e0c897
 **
3ed98e
 ** Convert GAP Integers to various C types -- see header file
b85239
--- src/integer.h.orig	2019-02-23 15:43:33.000000000 -0700
b85239
+++ src/integer.h	2019-03-12 13:39:47.358775285 -0600
3ed98e
@@ -135,6 +135,8 @@ extern Obj ObjInt_Int(Int i);
3ed98e
 extern Obj ObjInt_UInt(UInt i);
3ed98e
 extern Obj ObjInt_Int8(Int8 i);
3ed98e
 extern Obj ObjInt_UInt8(UInt8 i);
3ed98e
+extern Obj ObjInt_LongLong(long long i);
3ed98e
+extern Obj ObjInt_ULongLong(unsigned long long i);
3ed98e
 
3ed98e
 /**************************************************************************
e0c897
 **