Skip to content

Incorrect printing of error radius #299

Closed
@d0sboots

Description

@d0sboots
$ ./bin/pip list |grep flint
python-flint            0.7.1

$ ./bin/python
Python 3.13.3 (main, Apr 10 2025, 21:38:51) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from flint import *
>>> ctx.prec=54
>>> repr(arb.pi())
'[3.14159265358979 +/- 3.45e-15]'
>>> repr(arb.pi()-arb.pi())
'[+/- 2.23e-16]'
>>> repr(arb.pi().rad())
'[1.11022302462516e-16 +/- 3.46e-31]'
>>> repr(arb.pi().rad().rad())
'0'

As you can see, the radius is clearly being printed incorrectly. This is a result of flintlib/flint#2208 and flintlib/arb#391.

This is arguably an issue in flint itself, but arguably also a difference in semantics between flint and python. In this case, repr needs to round-trip values, so it needs to be using the ARB_STR_MORE flag.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions