[PATCH] numeric, ex: added constructors taking `long long`. Fixes MinGW64 build.
[ginac.git] / ginac / ex.cpp
index 73a3ba79239e7b8b34ba111416110c6b66f8430d..11ae077eb0fa66975b71f3ce20c1acc0f7708d72 100644 (file)
@@ -530,7 +530,25 @@ basic & ex::construct_from_ulong(unsigned long i)
                return dynallocate<numeric>(i);
        }
 }
-       
+
+basic & ex::construct_from_longlong(long long i)
+{
+       if (i >= -12 && i <= 12) {
+               return construct_from_int(static_cast<int>(i));
+       } else {
+               return dynallocate<numeric>(i);
+       }
+}
+
+basic & ex::construct_from_ulonglong(unsigned long long i)
+{
+       if (i <= 12) {
+               return construct_from_uint(static_cast<unsigned>(i));
+       } else {
+               return dynallocate<numeric>(i);
+       }
+}
+
 basic & ex::construct_from_double(double d)
 {
        return dynallocate<numeric>(d);