Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Inaccurate/misleading description of max in operators module (wrt. NaN comparison)

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
領域
documentation

調査の方向性

Issue でリンクされている max と compare の生成済みドキュメントエントリを確認し、次に示されている NaN の例を再現して動作を確認します。相違が想定されたものかどうかを判断します。完了とは、ドキュメントで max の NaN の動作が正確に説明されているか、または Issue が別途修正を必要とするバグであることが示されることです。

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

説明

Not sure if this is an error in documentation or purposeful omission, or perhaps a bug in fsharp.

Here max is described as

Maximum based on generic comparison

And here compare is described as

Generic comparison.

However, even though they kind of boil down to the same thing in implementation for most types, they do not specifically for floating point numbers. Moreover, if one defines a max function with compare, for example like this:

let max2 x y = if compare x y < 0 then y else x

Then max2 behaves differently than max with respect to NaN, e.g.:

> max2 1. nan;;
val it: float = 1.0

> max2 nan 1.;;
val it: float = 1.0

whereas

> max nan 1.;;
val it: float = nan

> max 1. nan;;
val it: float = nan

If this discrepancy in behavior is expected, then perhaps it should be documented?

主要言語
言語のデータがありません
スター
37
フォーク
20
平均マージ
5分
マージ済み PR(30日)
2

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

fsharp/fsharp-core-docs のほかの issue

fsharp/fsharp-core-docs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

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

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