Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly unintentional conversion of real number to rational #38634

Open
user202729 opened this issue Sep 7, 2024 · 0 comments
Open

Possibly unintentional conversion of real number to rational #38634

user202729 opened this issue Sep 7, 2024 · 0 comments

Comments

@user202729
Copy link
Contributor

user202729 commented Sep 7, 2024

Because QQ([element of RR]) tries to do a rational approximation, some part of the code that uses the constructor on user input has the following behavior…

sage: QuadraticField(pi.n())
Number Field in a with defining polynomial x^2 - 245850922/78256779 with a = 1.772453850905516?

sage: R.<x> = AsymptoticRing(growth_group='x^ZZ', coefficient_ring=ZZ)
sage: (1 + x)^(pi.n())
x^(245850922/78256779) + 245850922/78256779*x^(167594143/78256779) + 20601587289174923/6124123459454841*x^(89337364/78256779) + 1840491502630793355722972/1437762528405818857851417*x^(11080585/78256779) + 5098430634169557348880906924655/112514664439935388672910755005843*x^(-67176194/78256779) - 68498633075303442672509897293313532614/8805035229335182485655080241215399359697*x^(-145432973/78256779) + 4980979927288756272499089867645620034593240711/2067161088087893078113740853992180597265648907889*x^(-223689752/78256779) - 159170594950314274711966547531337367060627633645699096/161769368427893781189576754874137344728305890876260829531*x^(-301946531/78256779) + 6007626122806689076132415401891741471828772582757215638379497/12659549714031261070027065209722539002049849146701660082964140649*x^(-380203310/78256779) - 2284119337133569676886386334094220369253571089201542312095647795535070/8916260257894118369835704095222608474020660324910933528410817777243386139*x^(-458460089/78256779) + 104717755458887735895303392161722000487360506512316602734063646485366199482123/697757808508503026668072961689230627154962056480623119816535588003006898291386281*x^(-536716868/78256779) - 5109435066716738943030764777346834689842782240198560949438807023116814038100752595524/54604278615974240978794492118789587869297264407389641269773146055986362175064493795848899*x^(-614973647/78256779) + 785541979272120315935638662081031478279682412720434757807041439583840109007904194278527539007/12819464892314166137910792768472075576166030718100971371213749413114139115243944205185855219308963*x^(-693230426/78256779) - 41889353917822702810716721407423346015941075854991908158444781766335287806418143228222339116811863614/1003210030976088498023768431397117386035322733213639016282401349583452886516900872753560125823458050210177*x^(-771487205/78256779) + 2308364326665488334070391960384050247827590432575763751626804416553212448760293884316494965985096655029004205/78507985684678911874287982883020876516023937326775708282989284003654014597065191363982476229778549651068725039883*x^(-849743984/78256779) - 392303739892841898459699560171662605529040807859442574430029453222144458841593597253986709862424103253883933741890544/18431346256383243877519891376497042757702325666274012157011085572926562238355914187491655606559599536952636987773670350571*x^(-928000763/78256779) + 22753635621769426250560607286879206806844868021981194114109476418913929143826309649225898221511824553074692076619741868405317/1442377790658260855426177207554534869243061447451633122814529824230602364316764099913499057146645531291804846219429822643487270809*x^(-1006257542/78256779) - 1346824556019137914684670165324844676021493274771364609381686427070781920578166283680054973360038829336011070083897477716236573185342/112875839998051784287437300546432365710148156976642566481176518443723094261214494162064614831833409933640356361722905136620579141013064211*x^(-1084514321/78256779) + 730325259438610909274800496728115834122957380147366459793504942644792536767452967285184100338117799765489463260260743039518468921733993141391/79499696986502090221838879746968631936436181400005829383992146174558759123164278471137326719534183933939682299525341018630333218212422818657327321*x^(-1162771100/78256779) - 44694795014485209971024209255847244703714141482477445292484185000764333013099038472024080529087558208573575012291735287940959662023181532231982557900/6221390217639660057528506185966100149382028295424166788814779520918140235215700721010251655741381615063668317044166416994588869354008347574223540890159059*x^(-1241027879/78256779) + O(x^(-1319284658/78256779))

sage: B = Berkovich_Cp_Affine(Qp(3))
sage: B(3, power=pi.n())
Type II point centered at 3 + O(3^21) of radius 3^245850922/78256779

sage: Cusp(pi.n())
245850922/78256779

sage: Cusp(pi.n(), 2)
122925461/78256779

I've no idea what Berkovich_Cp_Affine is, but the rest surely doesn't seem intentional?

Originally posted by @user202729 in #38362 (comment)


Edit: to be more conservative, we could probably use QQ.coerce().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant