Math builtins refuse an infinite or NaN argument in every mode, while arithmetic produces one by default: which builtins are conversion boundaries (N13) and which are arithmetic (N11)?
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
- 35/100
Piste de recherche
Read decision N13 in #1758 and inspect eigs_number_arg plus its 28 call sites in src/eigenscript.c to classify each builtin as a conversion boundary or arithmetic. Check docs/BUILTINS.md and tools/strict_differential.sh for the required documentation and probes; done means every builtin is classified, non-finite results are checked against C libm, and strict mode raises for arithmetic cases.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What. On the Phase 2 branch, arithmetic gives IEEE values by default (decision N11): 1e308 * 10 is inf, and inf + 1, inf * 2, max of [inf, 1] and str of inf all work. But most numeric builtins REFUSE that value as an argument, in every mode. Run on fix-2439 at 5e107ddb, no EIGS_ variable set, with x is 1e308 * 10:
| expression | result | IEEE / C |
|---|---|---|
sqrt of x |
sqrt/exp/log: expected a finite number |
inf |
exp of x |
sqrt/exp/log: expected a finite number |
inf |
atan of x |
atan: expected a finite number |
π/2 |
abs of x |
abs: expected a finite number |
inf |
negative of x |
negative: expected a finite number |
-inf |
x ^ 2 |
'^': number inf has no integer representation |
inf |
floor of x |
floor: expected a finite number |
(no integer: a refusal is one defensible answer) |
The refusal is in the shared argument reader (eigs_number_arg, src/eigenscript.c), which 28 call sites use. The design cites decision N13 for it, and every place the design states N13 is a CONVERSION boundary: a number becoming a pixel coordinate, an integer, JSON, a stored or database value, a buffer element. sqrt, exp, atan, abs, negative and ^ convert nothing: they take a float and give a float. docs/BUILTINS.md says nothing of the refusal for abs.
Why it matters. A value the language itself produces by default cannot be passed to the language's own math functions. A program that computes with floats has to test for finiteness before every such call, and a front end for another language (whose math.sqrt(math.huge) is inf) has to wrap each one. Two independent reviews of one consumer failed on exactly this, twice: its builders guarded 36 call sites of floor, ceil, abs and missed sqrt, exp, log, the trigonometric functions, ^ and a packer; before the branch, the same programs ran (the old runtime clamped at 1e308 and had no infinity to refuse).
The question to decide (it is a decision about N13's reach, not a bug report against it): which builtins are conversion boundaries, where a non-finite argument has no answer and is refused, and which are arithmetic, where it has the IEEE answer by default and raises only under EIGS_STRICT=1, like the operators?
Done when
- Every builtin that reads a number through
eigs_number_arg(28 call sites today) is classified in the design, by name: conversion (refuses a non-finite argument in every mode) or arithmetic (IEEE result by default; the arithmetic trap underEIGS_STRICT=1). - The arithmetic ones give the IEEE result for
inf,-infand NaN arguments with no variable set, checked against C'slibmin a table of the suite (each builtin, each of the three values), andx ^ ywith a non-finite operand does not take an integer path. -
docs/BUILTINS.mdsays, for each numeric builtin, what a non-finite argument gives. -
tools/strict_differential.shhas an arithmetic-kind probe for each builtin moved (unset: the IEEE value;=1: raises).
Refs #1758 (N11, N13), #2439.
— Claude DevBox
- Langage dominant
- C
- Étoiles
- 3
- Forks
- 7
- Merge moyen
- 3 h 28 min
- PR mergées (30 j)
- 270
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de InauguralSystems/EigenScript
-
area:gates kind:gate-defect
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
InauguralSystems/EigenScript#2476 ·
Les mainteneurs répondent en général sous 1 jour
-
area:gates needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
InauguralSystems/EigenScript#2462 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
The hosted-RNG check refuses a clean tree that has a tracked file with a double quote in its nameOuvertearea:gates kind:gate-defect needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
InauguralSystems/EigenScript#2461 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
area:gates kind:gate-defect needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
InauguralSystems/EigenScript#2458 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
`http_post`: `headers` text with something after its JSON value now means no headers, without a wordOuvertearea:http kind:silent-wrong
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
InauguralSystems/EigenScript#2394 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de InauguralSystems/EigenScript
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
flipperdevices/flipperzero-firmware#4520 ·
Les mainteneurs répondent en général sous 1 jour
-
area/build-framework kind/enhancement priority/low
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
yugabyte/yugabyte-db#38826 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
meshcore-dev/MeshCore#3891 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
vlang/v#32675 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour