Canonical float equality does not conform to RFC8949

Aperta
#217 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
haskell
Ambito
backend

Direzione di ricerca

Start by locating the canonical float equality and map key equivalence implementation in the Haskell code, then inspect the related tests. The issue requires integers to remain unequal to floats, equal numeric values across float widths to compare equal, and signed zero and NaN significands to follow RFC 8949 §5.6.1. Add or update tests for these cases and run the relevant test suite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

According to the spec:

RFC8949 §2.

Note that integer and floating-point values are distinct in this
model, even if they have the same numeric value.

Also note that serialization variants are not visible at the generic
data model level. This deliberate absence of visibility includes the
number of bytes of the encoded floating-point value. It also
includes the choice of encoding for an "argument" (see Section 3)
such as the encoding for an integer, the encoding for the length of a
text or byte string, the encoding for the number of elements in an
array or pairs in a map, or the encoding for a tag number.

This means that integer types are always unequal to floating point numbers, even if numerically they would be equal. However floating point numbers with different bit widths can still be equal if they represent the same numerical value.

Additionally

RFC8949 §5.6.1.

Within each of these groups, numeric values are distinct unless they
are numerically equal (specifically, -0.0 is equal to 0.0); for the
purpose of map key equivalence, NaN values are equivalent if they
have the same significand after zero-extending both significands at
the right to 64 bits.

Lingua principale
Haskell
Stelle
8
Fork
5
Merge medio
3g 12h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di IntersectMBO/cuddle

Tutte le issue di IntersectMBO/cuddle

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.