Arithmetic operations on Quantities with special units should return null

Aperta
#399 3 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
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
backend

Direzione di ricerca

Start by locating the implementations of Add, Divide, Modulo, Multiply, Subtract, and Truncated Divide, then read how the project represents and validates UCUM units. Add or find tests for arithmetic involving offset and logarithmic special units, including the Fahrenheit/Celsius examples in the issue. Done means these operations return null for invalid or special units instead of producing meaningless quantities or throwing errors.

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

Descrizione

In the definitions of the following arithmetic operators, the spec says "Attempting to operate on quantities with invalid or special units will result in a null. "

The term "special units" isn't defined in CQL itself so I believe it refers to the UCUM "special units" https://ucum.org/ucum#section-Special-Units-on-non-ratio-Scales which includes things like temperature scales with offsets, and logarithmic scales like pH, dB, etc.

Currently, we don't do anything different for "special" units in these operations, so we can get meaningless results:

define "SpecialUnitsTest": 10 '[degF]' + 2 'Cel'

-->

45.6 '[degF]'

or throw errors:

define "SpecialUnitsTest": 10 '[degF]' * 2 'Cel'

(throws when trying to construct a Quantity with units [degF]2)

Lingua principale
JavaScript
Stelle
84
Fork
41
Merge medio
5g 4h
PR unite (30g)
3

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 cqframework/cql-execution

Tutte le issue di cqframework/cql-execution

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.