14 Commits

Author SHA1 Message Date
Sergey B Kirpichev 70b722800f Use shortest decimal representations for str/repr
Was:
```
$ python -m mpmath
>>> 0.1
0.10000000000000001
```

Now:
```
$ python -m mpmath --shortest-str
>>> 0.1
0.1
```

Closes #1028
2026-08-20 12:46:40 +03:00
Sergey B Kirpichev f9822f0954 Test on CPython 3.15 (no GMP)
DeprecationWarning's are filtered out in pyexpect-enabled tests,
see pexpect/pexpect#827.
2026-04-03 11:11:36 +03:00
Sergey B Kirpichev 7c3252b14c Add option --int-limits for CLI
This enables *default* Python mechanism for integer string
conversion length limitation:
https://docs.python.org/3/library/stdtypes.html#integer-string-conversion-length-limitation

For the mpmath CLI it will be *off* by default.  Usually, it doesn't
matter, as these limits not affect the gmpy2/gmp backends and working
with mpmath's types (mpf/mpc).  Though, sometimes you want to play with
integers in the mpmath console and these limits are really annoying.

I consider this as a bugfix, despite it adds a new option.
2026-02-22 08:01:03 +03:00
Sergey B Kirpichev eefdb4d0c4 Add tests for demo scripts
Closes #1029
2026-02-19 16:17:27 +03:00
Sergey B Kirpichev 57147a724a Workaround support for multiple statements in CLI
Closes #996
2025-10-02 07:44:36 +03:00
Sergey B Kirpichev 84bddafd07 Support bin/hex float literals in the CLI
See skirpichev/peps#4 and python/cpython#114667.
2025-05-11 08:58:06 +03:00
Sergey B Kirpichev c945b4d2b0 Use PyREPL, as fallback (no IPython)
Closes #938
2025-04-16 08:27:22 +03:00
Sergey B Kirpichev 2c82152738 Fix source transformation in IPython, add tests 2025-04-13 12:37:27 +03:00
Sergey B Kirpichev 210a6a77da Fix wrap_float_literals() to detect all float/complex literals 2025-04-08 06:01:58 +03:00
Sergey B Kirpichev a14901da43 Add pretty_dps context property to control number of printed digits
Closes #921
2025-03-30 09:13:43 +03:00
Sergey B Kirpichev 23b9054b3f Fix runsource() for incomplete input 2025-03-18 16:26:22 +03:00
Sergey B Kirpichev d66b8f2536 Enable pretty-printing in CLI per default 2025-03-03 04:37:10 +03:00
Doug Torrance 4f3c60df81 Use sys.executable instead of "python" for test_cli (#789)
Some systems (e.g., Debian/Ubuntu) ship a "python3" command instead of
"python" per PEP 394.  But we may not be able to guarantee if
"python3" exists either, so we use sys.executable to determine the
name of the command.
2024-04-19 07:15:08 +03:00
Sergey B Kirpichev 5f724296dd Run mpmath as a module for interactive work
Example:
```
$ python -m mpmath --prec 100 --no-ipython
>>> 10.9
mpf('10.899999999999999999999999999995')
>>> mpf(1090/100)
mpf('10.899999999999999999999999999995')
>>> mpf('10.9')
mpf('10.899999999999999999999999999995')
>>> mpf(109)/mpf(10)
mpf('10.899999999999999999999999999995')
>>> mpf(10.9)
mpf('10.899999999999999999999999999995')
```

Closes #677
Closes #765
2024-04-14 10:20:44 +03:00