* Implementation of GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2022 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
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);