sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.46k stars 482 forks source link

Should parent of `RealLiteral` be `RealLazyField`? #38996

Open user202729 opened 4 days ago

user202729 commented 4 days ago

Problem Description

Currently we have this behavior:

sage: F = RealField(100)
sage: Sequence([2.3, F(1)]).universe()
Real Field with 53 bits of precision

even though a RealLiteral effectively have "infinite" precision.

Proposed Solution

We make the parent be RealLazyField instead.

sage: Sequence([RealLazyField()(2.3), F(1)]).universe()
Real Field with 100 bits of precision

Alternatives Considered

Not sure.

Additional Information

Motivation is https://github.com/sagemath/sage/issues/38364

Is there an existing issue for this?