Skip to content

Conversation

@SwayamInSync
Copy link
Member

@SwayamInSync SwayamInSync commented Oct 23, 2025

closes #196

Cause:
For conversion from quad -> string, earlier we were using the strict 33 as significant decimal digit precision for dragon4 (which is the minimum value) so some random inputs were getting successfully round-trip but not all.
For example with original behaviour, np.random.seed(0) should pass but not np.random.seed(1) or others

128-bit quad support 33-36 so we should be setting this value to the max, as for any irregular representation Quad(x) can give upto max 36 significant decimal digit precision but our conversion to string will only preserve 33.

source: https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format

Copy link
Contributor

@juntyr juntyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ngoldbaum
Copy link
Member

LGTM!

@ngoldbaum ngoldbaum merged commit f52ffdf into numpy:main Oct 23, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Round-tripping a QuadPrecision through string is broken

3 participants