Arithmetic operations on Quantities with special units should return null

オープン
#399 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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)

主要言語
JavaScript
スター
85
フォーク
40
平均マージ
5日 4時間
マージ済み PR(30日)
3

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cqframework/cql-execution のほかの issue

cqframework/cql-execution の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。