Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

An exact whole power with a huge exponent hangs evaluation: 2^(10^9), 2^(3^20)

Ouverte
#1,448 7 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
32/100
Type d'issue
Bug
Clarté
À clarifier
Activité
Active
Stack technique
csharp
Domaine
performance

Piste de recherche

Start by reproducing the two expressions through ToEntity().Evaled and trace the Number.Pow/BinaryIntPow path described in the issue. Review the quantifier witness-search path and related issue #1338, then establish the chosen behavior for oversized exact powers and confirm that witness searches remain bounded without silently losing exactness.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

"2^(10^9)".ToEntity().Evaled and "2^(3^20)".ToEntity().Evaled do not return (killed at 60 s each; 2^(3^12) returns in 1 s). The result of the first is a 10⁹-bit integer (125 MB) and of the second a 3.5·10⁹-bit one; Number.Pow's BinaryIntPow builds them by squaring in EInteger, and the last squarings are Toom-4 multiplications of numbers hundreds of megabytes long. Measured on 8fcfaf42 (a branch of 345914f6); the code path is unchanged since long before.

Found through a quantifier: forall n in ZZ* : 3^(n + 1) divides 2^(3^n) + 1 (Sullivan and Mackey's Prob 5.7.13) hangs because a witness search evaluates the body at n = 20 or so, where 2^(3^n) is the second number above. Any consumer that evaluates a tower at a large argument hits the same.

What the answer should be is the decision to make, and it belongs with #1338's numerics: an exact power whose result would exceed some size — say 2²⁴ bits, which is 2 MB and a fraction of a second — is either (a) left as written (2^(10^9) evaluates to itself, the way an unsolved statement stays a statement), or (b) refused with an exception naming the limit, or (c) evaluated approximately as Real at the working precision, which is what a decimal calculator does and loses exactness silently. (a) is the honest one under not answering is legitimate; answering wrongly is not, and it composes: a witness search that gets an unevaluated power back moves on. Until then, a quantifier's witness search should skip a sample it cannot evaluate in bounded time, which is the narrower fix I would take first.

Part of #1409.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

Langage dominant
C#
Étoiles
831
Forks
79
Merge moyen
2 h 22 min
PR mergées (30 j)
507

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de ASC-Community/AngouriMath

Toutes les issues de ASC-Community/AngouriMath

Issues similaires

Plus d'issues C#

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.