Arithmetic operations on Quantities with special units should return null

Abierto
#399 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
50/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
JavaScript
Estrellas
85
Forks
40
Merge medio
5 d 4 h
PR fusionados (30 d)
3

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cqframework/cql-execution

Todos los issues de cqframework/cql-execution

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.