]> www.ginac.de Git - ginac.git/blobdiff - ginac/numeric.cpp
[PATCH] numeric, ex: added constructors taking `long long`. Fixes MinGW64 build.
[ginac.git] / ginac / numeric.cpp
index a54cca38ed3d47afa22274ac4d70646a944d4ccd..1f87f422b05ccf9371119a0345083b9338084001 100644 (file)
@@ -7,7 +7,7 @@
  *  of special functions or implement the interface to the bignum package. */
 
 /*
- *  GiNaC Copyright (C) 1999-2018 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -141,6 +141,17 @@ numeric::numeric(unsigned long i)
        setflag(status_flags::evaluated | status_flags::expanded);
 }
 
+numeric::numeric(long long i)
+{
+       value = cln::cl_I(i);
+       setflag(status_flags::evaluated | status_flags::expanded);
+}
+
+numeric::numeric(unsigned long long i)
+{
+       value = cln::cl_I(i);
+       setflag(status_flags::evaluated | status_flags::expanded);
+}
 
 /** Constructor for rational numerics a/b.
  *
@@ -506,7 +517,7 @@ static void print_real_cl_N(const print_context & c, const cln::cl_R & x)
                if (coerce(dst, cln::the<cln::cl_I>(x))) {
                        // can be converted to native int
                        if (dst < 0)
-                               c.s << "(-" << dst << ")";
+                               c.s << '(' << dst << ')';
                        else
                                c.s << dst;
                } else {