Skip to content

Commit b6b50a8

Browse files
author
Release Manager
committed
gh-36235: support for ecl 23.9.9 ecl 23.9.9 has two minor changes that affect sagemath: - api for bignums changed, so the macro `ecl_mpz_from_bignum` has to be (conditionally) changed - printing of floating point numbers changed `1.e40` to `1.0e40`, I changed the example to `1.234e40` which prints the same in 23.9.9 as in previous versions. With this changes sagemath should work ok with either 21.2.1 or 23.9.9. URL: #36235 Reported by: Gonzalo Tornaría Reviewer(s):
2 parents 683b05b + 26f1b72 commit b6b50a8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/sage/libs/ecl.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,15 +563,15 @@ cdef class EclObject:
563563
Floats in Python are IEEE double, which LISP has as well. However,
564564
the printing of floating point types in LISP depends on settings::
565565
566-
sage: a = EclObject(float(10^40))
566+
sage: a = EclObject(float(1.234e40))
567567
sage: ecl_eval("(setf *read-default-float-format* 'single-float)")
568568
<ECL: SINGLE-FLOAT>
569569
sage: a
570-
<ECL: 1.d40>
570+
<ECL: 1.234d40>
571571
sage: ecl_eval("(setf *read-default-float-format* 'double-float)")
572572
<ECL: DOUBLE-FLOAT>
573573
sage: a
574-
<ECL: 1.e40>
574+
<ECL: 1.234e40>
575575
576576
Tuples are translated to dotted lists::
577577

src/sage/libs/eclsig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ static inline void ecl_sig_off(void)
4545
sig_off();
4646
}
4747

48+
#if ECL_VERSION_NUMBER < 230909
4849
#define ecl_mpz_from_bignum(obj) ((obj)->big.big_num)
50+
#else
51+
#define ecl_mpz_from_bignum(obj) ecl_bignum(obj)
52+
#endif
4953

5054
cl_object ecl_bignum_from_mpz(mpz_t num)
5155
{

0 commit comments

Comments
 (0)